Storm 2.0.0.3
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
IntervalterationHelper.h
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4#include <memory>
5#include <optional>
6#include <vector>
7
15
16namespace storm::solver::helper {
17
18template<typename ValueType>
19struct IIData {
20 std::vector<ValueType> const& x;
21 std::vector<ValueType> const& y;
23};
24
29template<typename ValueType, bool TrivialRowGrouping>
31 public:
33
34 template<OptimizationDirection Dir, typename OffsetType, bool Smooth = false, bool InvertedXDir = false>
35 SolverStatus II(std::pair<std::vector<ValueType>, std::vector<ValueType>>& xy, OffsetType const& offsets, uint64_t& numIterations, bool relative,
36 ValueType const& precision, std::function<SolverStatus(IIData<ValueType> const&)> const& iterationCallback = {},
37 std::optional<storm::storage::BitVector> const& relevantValues = {}, ValueType const& gamma = storm::utility::zero<ValueType>()) const;
38
44 SolverStatus smoothII(std::pair<std::vector<ValueType>, std::vector<ValueType>>& xy,
45 std::pair<std::vector<ValueType>, std::vector<ValueType>> const& offsets, uint64_t& numIterations, bool relative,
46 ValueType const& precision, ValueType const& gamma, ValueType const& delta,
47 std::optional<storm::OptimizationDirection> const& dir = {},
48 std::function<SolverStatus(IIData<ValueType> const&)> const& iterationCallback = {},
49 std::optional<storm::storage::BitVector> const& relevantValues = {}) const;
50
58 SolverStatus roundII(std::pair<std::vector<ValueType>, std::vector<ValueType>>& xy,
59 std::pair<std::vector<ValueType>, std::vector<ValueType>> const& offsets, uint64_t& numIterations, bool relative,
60 ValueType const& precision, ValueType const& gamma, ValueType const& delta,
61 std::optional<storm::OptimizationDirection> const& dir = {},
62 std::function<SolverStatus(IIData<ValueType> const&)> const& iterationCallback = {},
63 std::optional<storm::storage::BitVector> const& relevantValues = {}) const;
64
65 SolverStatus II(std::pair<std::vector<ValueType>, std::vector<ValueType>>& xy, std::pair<std::vector<ValueType>, std::vector<ValueType>> const& offsets,
66 uint64_t& numIterations, bool relative, ValueType const& precision, std::optional<storm::OptimizationDirection> const& dir = {},
67 std::function<SolverStatus(IIData<ValueType> const&)> const& iterationCallback = {},
68 std::optional<storm::storage::BitVector> const& relevantValues = {}) const;
69
70 SolverStatus II(std::vector<ValueType>& operand, std::vector<ValueType> const& offsets, uint64_t& numIterations, bool relative, ValueType const& precision,
71 std::function<void(std::vector<ValueType>&)> const& prepareLowerBounds,
72 std::function<void(std::vector<ValueType>&)> const& prepareUpperBounds, std::optional<storm::OptimizationDirection> const& dir = {},
73 std::function<SolverStatus(IIData<ValueType> const&)> const& iterationCallback = {},
74 std::optional<storm::storage::BitVector> const& relevantValues = {},
76
77 SolverStatus II(std::vector<ValueType>& operand, std::vector<ValueType> const& offsets, bool relative, ValueType const& precision,
78 std::function<void(std::vector<ValueType>&)> const& prepareLowerBounds,
79 std::function<void(std::vector<ValueType>&)> const& prepareUpperBounds, std::optional<storm::OptimizationDirection> const& dir = {},
80 std::function<SolverStatus(IIData<ValueType> const&)> const& iterationCallback = {},
81 std::optional<storm::storage::BitVector> const& relevantValues = {}) const;
82
83 private:
84 std::shared_ptr<ValueIterationOperator<ValueType, TrivialRowGrouping>> viOperator;
85};
86
87} // namespace storm::solver::helper
Helper class that optionally holds a reference to an object of type T.
Definition OptionalRef.h:48
SolverStatus II(std::pair< std::vector< ValueType >, std::vector< ValueType > > &xy, OffsetType const &offsets, uint64_t &numIterations, bool relative, ValueType const &precision, std::function< SolverStatus(IIData< ValueType > const &)> const &iterationCallback={}, std::optional< storm::storage::BitVector > const &relevantValues={}, ValueType const &gamma=storm::utility::zero< ValueType >()) const
SolverStatus roundII(std::pair< std::vector< ValueType >, std::vector< ValueType > > &xy, std::pair< std::vector< ValueType >, std::vector< ValueType > > const &offsets, uint64_t &numIterations, bool relative, ValueType const &precision, ValueType const &gamma, ValueType const &delta, std::optional< storm::OptimizationDirection > const &dir={}, std::function< SolverStatus(IIData< ValueType > const &)> const &iterationCallback={}, std::optional< storm::storage::BitVector > const &relevantValues={}) const
Variant of interval iteration for floating point numbers with directed rounding.
SolverStatus smoothII(std::pair< std::vector< ValueType >, std::vector< ValueType > > &xy, std::pair< std::vector< ValueType >, std::vector< ValueType > > const &offsets, uint64_t &numIterations, bool relative, ValueType const &precision, ValueType const &gamma, ValueType const &delta, std::optional< storm::OptimizationDirection > const &dir={}, std::function< SolverStatus(IIData< ValueType > const &)> const &iterationCallback={}, std::optional< storm::storage::BitVector > const &relevantValues={}) const
Smooth variant of interval iteration: Instead of taking over the bounds computed by the Bellman opera...
IntervalIterationHelper(std::shared_ptr< ValueIterationOperator< ValueType, TrivialRowGrouping > > viOperator)
This class represents the Value Iteration Operator (also known as Bellman operator).
ValueType zero()
Definition constants.cpp:26
constexpr NullRefType NullRef
Definition OptionalRef.h:31
std::vector< ValueType > const & y
std::vector< ValueType > const & x