23template<storm::dd::DdType DdType,
typename ValueType>
28template<storm::dd::DdType DdType,
typename ValueType>
31 std::set<storm::expressions::Variable>
const& columnMetaVariables,
32 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs)
37template<storm::dd::DdType DdType,
typename ValueType>
40 std::set<storm::expressions::Variable>
const& columnMetaVariables,
41 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs)
43 rowMetaVariables(rowMetaVariables),
44 columnMetaVariables(columnMetaVariables),
45 rowColumnMetaVariablePairs(rowColumnMetaVariablePairs) {
49template<storm::dd::DdType DdType,
typename ValueType>
55 for (uint_fast64_t i = 0; i < n; ++i) {
56 xCopy = xCopy.
swapVariables(this->rowColumnMetaVariablePairs);
66template<storm::dd::DdType DdType,
typename ValueType>
71template<storm::dd::DdType DdType,
typename ValueType>
77template<storm::dd::DdType DdType,
typename ValueType>
82template<storm::dd::DdType DdType,
typename ValueType>
85 std::set<storm::expressions::Variable>
const& columnMetaVariables,
86 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs) {
87 this->setAllRows(allRows);
88 this->rowMetaVariables = rowMetaVariables;
89 this->columnMetaVariables = columnMetaVariables;
90 this->rowColumnMetaVariablePairs = rowColumnMetaVariablePairs;
93template<storm::dd::DdType DdType,
typename ValueType>
96 std::set<storm::expressions::Variable>
const& rowMetaVariables, std::set<storm::expressions::Variable>
const& columnMetaVariables,
97 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs)
const {
98 std::unique_ptr<storm::solver::SymbolicLinearEquationSolver<DdType, ValueType>> solver =
99 this->create(env, allRows, rowMetaVariables, columnMetaVariables, rowColumnMetaVariablePairs);
100 solver->setMatrix(A);
104template<storm::dd::DdType DdType,
typename ValueType>
107 std::set<storm::expressions::Variable>
const& columnMetaVariables,
108 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs)
const {
109 std::unique_ptr<storm::solver::SymbolicLinearEquationSolver<DdType, ValueType>> solver = this->create(env);
110 solver->setData(allRows, rowMetaVariables, columnMetaVariables, rowColumnMetaVariablePairs);
114template<storm::dd::DdType DdType,
typename ValueType>
116 return this->create(env)->getEquationProblemFormat(env);
119template<storm::dd::DdType DdType,
typename ValueType>
121 return this->create(env)->getRequirements(env);
125std::unique_ptr<storm::solver::SymbolicLinearEquationSolver<storm::dd::DdType::Sylvan, storm::RationalFunction>>
130 if (type != EquationSolverType::Elimination) {
131 type = EquationSolverType::Elimination;
132 STORM_LOG_INFO(
"The selected equation solver is not available in the parametric dd engine. Falling back to " <<
toString(type) <<
" solver.");
136 case EquationSolverType::Elimination:
137 return std::make_unique<SymbolicEliminationLinearEquationSolver<storm::dd::DdType::Sylvan, storm::RationalFunction>>();
139 STORM_LOG_THROW(
false, storm::exceptions::InvalidEnvironmentException,
"Unknown solver type.");
144template<storm::dd::DdType DdType,
typename ValueType>
150 if (type != EquationSolverType::Native && type != EquationSolverType::Elimination) {
151 type = EquationSolverType::Native;
152 STORM_LOG_INFO(
"The selected equation solver is not available in the dd engine. Falling back to " <<
toString(type) <<
" solver.");
156 case EquationSolverType::Native:
157 return std::make_unique<SymbolicNativeLinearEquationSolver<DdType, ValueType>>();
158 case EquationSolverType::Elimination:
159 return std::make_unique<SymbolicEliminationLinearEquationSolver<DdType, ValueType>>();
161 STORM_LOG_THROW(
false, storm::exceptions::InvalidEnvironmentException,
"Unknown solver type.");
SolverEnvironment & solver()
storm::solver::EquationSolverType const & getLinearEquationSolverType() const
Add< LibraryType, ValueType > swapVariables(std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &metaVariablePairs) const
Swaps the given pairs of meta variables in the ADD.
Add< LibraryType, ValueType > multiplyMatrix(Add< LibraryType, ValueType > const &otherMatrix, std::set< storm::expressions::Variable > const &summationMetaVariables) const
Multiplies the current ADD (representing a matrix) with the given matrix by summing over the given me...
virtual std::unique_ptr< storm::solver::SymbolicLinearEquationSolver< DdType, ValueType > > create(Environment const &env) const override
std::unique_ptr< storm::solver::SymbolicLinearEquationSolver< DdType, ValueType > > create(Environment const &env, storm::dd::Bdd< DdType > const &allRows, std::set< storm::expressions::Variable > const &rowMetaVariables, std::set< storm::expressions::Variable > const &columnMetaVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs) const
LinearEquationSolverRequirements getRequirements(Environment const &env) const
LinearEquationSolverProblemFormat getEquationProblemFormat(Environment const &env) const
An interface that represents an abstract symbolic linear equation solver.
virtual void setData(storm::dd::Bdd< DdType > const &allRows, std::set< storm::expressions::Variable > const &rowMetaVariables, std::set< storm::expressions::Variable > const &columnMetaVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs)
virtual storm::dd::Add< DdType, ValueType > multiply(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.
SymbolicLinearEquationSolver()
virtual LinearEquationSolverProblemFormat getEquationProblemFormat(Environment const &env) const
Retrieves the format in which this solver expects to solve equations.
void setMatrix(storm::dd::Add< DdType, ValueType > const &newA)
virtual LinearEquationSolverRequirements getRequirements(Environment const &env) const
Retrieves the requirements of the solver under the current settings.
#define STORM_LOG_INFO(message)
#define STORM_LOG_THROW(cond, exception, message)
LinearEquationSolverProblemFormat
std::string toString(GurobiSolverMethod const &method)
Yields a string representation of the GurobiSolverMethod.