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