Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
RationalSearchHelper.h
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4#include <memory>
5#include <optional>
6#include <type_traits>
7#include <vector>
8
11
13
14namespace storm::solver::helper {
15
17
25template<typename TargetValueType, typename ExactValueType, typename ImpreciseValueType, bool TrivialRowGrouping>
27 public:
28 static const bool IsTargetExact = std::is_same_v<TargetValueType, ExactValueType>;
29
31 std::shared_ptr<ValueIterationOperator<ImpreciseValueType, TrivialRowGrouping>> impreciseViOperator);
32
33 template<storm::OptimizationDirection Dir>
34 SolverStatus RS(std::vector<TargetValueType>& operand, std::vector<TargetValueType> const& offsets, uint64_t& numIterations,
35 TargetValueType const& precision, std::function<SolverStatus(SolverStatus const&)> const& iterationCallback = {}) const;
36
37 SolverStatus RS(std::vector<TargetValueType>& operand, std::vector<TargetValueType> const& offsets, uint64_t& numIterations,
38 TargetValueType const& precision, std::optional<storm::OptimizationDirection> const& dir = {},
39 std::function<SolverStatus(SolverStatus const&)> const& iterationCallback = {}) const;
40
41 SolverStatus RS(std::vector<TargetValueType>& operand, std::vector<TargetValueType> const& offsets, TargetValueType const& precision,
42 std::optional<storm::OptimizationDirection> const& dir = {},
43 std::function<SolverStatus(SolverStatus const&)> const& iterationCallback = {}) const;
44
45 private:
46 template<typename ValueType, storm::OptimizationDirection Dir>
47 std::pair<RSResult, SolverStatus> RS(std::vector<ValueType>& operand, std::vector<ValueType> const& offsets, uint64_t& numIterations,
48 ExactValueType precision, std::vector<ExactValueType> const& exactOffsets, std::vector<TargetValueType>& target,
49 std::function<SolverStatus(SolverStatus const&)> const& iterationCallback) const;
50
51 template<typename ValueType>
52 std::shared_ptr<ValueIterationOperator<ValueType, TrivialRowGrouping>> const& getOperator() const;
53
54 template<typename ValueType, storm::OptimizationDirection Dir>
55 RSResult sharpen(uint64_t precision, std::vector<ValueType> const& operand, std::vector<ExactValueType> const& exactOffsets,
56 std::vector<TargetValueType>& target) const;
57
58 std::shared_ptr<ValueIterationOperator<ExactValueType, TrivialRowGrouping>> exactOperator;
59 std::shared_ptr<ValueIterationOperator<ImpreciseValueType, TrivialRowGrouping>> impreciseOperator;
60};
61
62} // namespace storm::solver::helper
SolverStatus RS(std::vector< TargetValueType > &operand, std::vector< TargetValueType > const &offsets, uint64_t &numIterations, TargetValueType const &precision, std::function< SolverStatus(SolverStatus const &)> const &iterationCallback={}) const
This class represents the Value Iteration Operator (also known as Bellman operator).