1#ifndef STORM_SOLVER_SYMBOLICMINMAXLINEAREQUATIONSOLVER_H_
2#define STORM_SOLVER_SYMBOLICMINMAXLINEAREQUATIONSOLVER_H_
4#include <boost/optional.hpp>
26template<storm::dd::DdType Type,
typename ValueType>
29template<storm::dd::DdType T>
38template<storm::dd::DdType DdType,
typename ValueType>
114 boost::optional<storm::solver::OptimizationDirection>
const& direction = boost::none)
const;
143 MinMaxMethod getMethod(
Environment const& env,
bool isExactMode)
const;
162 template<
typename RationalType,
typename ImpreciseType>
168 template<
typename RationalType,
typename ImpreciseType>
175 template<
typename ImpreciseType>
179 template<
typename ImpreciseType>
183 template<
typename ImpreciseType>
188 template<storm::dd::DdType DdTypePrime,
typename ValueTypePrime>
191 struct ValueIterationResult {
193 : status(status), iterations(iterations), values(values) {
204 uint64_t maximalIterations)
const;
247template<storm::dd::DdType DdType,
typename ValueType>
252 virtual std::unique_ptr<storm::solver::SymbolicMinMaxLinearEquationSolver<DdType, ValueType>>
create(
254 std::set<storm::expressions::Variable>
const& rowMetaVariables, std::set<storm::expressions::Variable>
const& columnMetaVariables,
255 std::set<storm::expressions::Variable>
const& choiceVariables,
256 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs)
const = 0;
263 boost::optional<storm::solver::OptimizationDirection>
const& direction = boost::none)
const;
266 virtual std::unique_ptr<storm::solver::SymbolicMinMaxLinearEquationSolver<DdType, ValueType>>
create()
const = 0;
269template<storm::dd::DdType DdType,
typename ValueType>
272 virtual std::unique_ptr<storm::solver::SymbolicMinMaxLinearEquationSolver<DdType, ValueType>>
create(
274 std::set<storm::expressions::Variable>
const& rowMetaVariables, std::set<storm::expressions::Variable>
const& columnMetaVariables,
275 std::set<storm::expressions::Variable>
const& choiceVariables,
276 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs)
const override;
279 virtual std::unique_ptr<storm::solver::SymbolicMinMaxLinearEquationSolver<DdType, ValueType>> create()
const override;
virtual std::unique_ptr< storm::solver::SymbolicMinMaxLinearEquationSolver< DdType, ValueType > > create(storm::dd::Add< DdType, ValueType > const &A, storm::dd::Bdd< DdType > const &allRows, storm::dd::Bdd< DdType > const &illegalMask, std::set< storm::expressions::Variable > const &rowMetaVariables, std::set< storm::expressions::Variable > const &columnMetaVariables, std::set< storm::expressions::Variable > const &choiceVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs) const override
storm::dd::Bdd< DdType > allRows
An interface that represents an abstract symbolic linear equation solver.
virtual ~SymbolicMinMaxLinearEquationSolverFactory()=default
virtual std::unique_ptr< storm::solver::SymbolicMinMaxLinearEquationSolver< DdType, ValueType > > create(storm::dd::Add< DdType, ValueType > const &A, storm::dd::Bdd< DdType > const &allRows, storm::dd::Bdd< DdType > const &illegalMask, std::set< storm::expressions::Variable > const &rowMetaVariables, std::set< storm::expressions::Variable > const &columnMetaVariables, std::set< storm::expressions::Variable > const &choiceVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs) const =0
MinMaxLinearEquationSolverRequirements getRequirements(Environment const &env, bool hasUniqueSolution=false, boost::optional< storm::solver::OptimizationDirection > const &direction=boost::none) const
Retrieves the requirements of the solver that would be created when calling create() right now.
An interface that represents an abstract symbolic linear equation solver.
boost::optional< storm::dd::Bdd< DdType > > initialScheduler
bool hasUniqueSolution() const
Retrieves whether the solution to the min max equation system is assumed to be unique.
friend class SymbolicMinMaxLinearEquationSolver
bool hasInitialScheduler() const
Retrieves whether an initial scheduler was set.
void setHasUniqueSolution(bool value=true)
Sets whether the solution to the min max equation system is known to be unique.
virtual storm::dd::Add< DdType, ValueType > multiply(storm::solver::OptimizationDirection const &dir, storm::dd::Add< DdType, ValueType > const &x, storm::dd::Add< DdType, ValueType > const *b=nullptr, uint_fast64_t n=1) const
Performs repeated matrix-vector multiplication, using x[0] = x and x[i + 1] = A*x[i] + b.
virtual storm::dd::Add< DdType, ValueType > solveEquations(Environment const &env, storm::solver::OptimizationDirection const &dir, storm::dd::Add< DdType, ValueType > const &x, storm::dd::Add< DdType, ValueType > const &b) const
Solves the equation system A*x = b.
storm::dd::Add< DdType, ValueType > illegalMaskAdd
storm::dd::Bdd< DdType > illegalMask
bool isSolution(OptimizationDirection dir, storm::dd::Add< DdType, ValueType > const &x, storm::dd::Add< DdType, ValueType > const &b) const
Determines whether the given vector x satisfies x = min/max Ax + b.
void setInitialScheduler(storm::dd::Bdd< DdType > const &scheduler)
Sets an initial scheduler that is required by some solvers (see requirements).
bool isRequirementsCheckedSet() const
Retrieves whether the solver is aware that the requirements were checked.
std::set< storm::expressions::Variable > rowMetaVariables
std::set< storm::expressions::Variable > choiceVariables
storm::dd::Bdd< DdType > const & getInitialScheduler() const
Retrieves the initial scheduler (if there is any).
std::unique_ptr< SymbolicLinearEquationSolverFactory< DdType, ValueType > > linearEquationSolverFactory
storm::dd::Add< DdType, ValueType > A
std::set< storm::expressions::Variable > columnMetaVariables
void setRequirementsChecked(bool value=true)
Notifies the solver that the requirements for solving equations have been checked.
std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > rowColumnMetaVariablePairs
virtual ~SymbolicMinMaxLinearEquationSolver()=default
virtual MinMaxLinearEquationSolverRequirements getRequirements(Environment const &env, boost::optional< storm::solver::OptimizationDirection > const &direction=boost::none) const
Retrieves the requirements of the solver.