23template<
typename ValueType>
25 return std::unique_ptr<storm::solver::LpSolver<ValueType>>(
29template<
typename ValueType>
31 std::string
const& name)
const {
32 return std::unique_ptr<storm::solver::LpSolver<ValueType, true>>(
36template<
typename ValueType>
38 return std::make_unique<GlpkLpSolverFactory<ValueType>>(*this);
41template<
typename ValueType>
46template<
typename ValueType>
48 std::string
const& name)
const {
52template<
typename ValueType>
54 return std::make_unique<SoplexLpSolverFactory<ValueType>>(*this);
57template<
typename ValueType>
62template<
typename ValueType>
67template<
typename ValueType>
69 return std::make_unique<HighsLpSolverFactory<ValueType>>(*this);
72template<
typename ValueType>
73std::shared_ptr<storm::solver::GurobiEnvironment>
const& GurobiLpSolverFactory<ValueType>::getOrCreateGurobiEnvironment(
storm::Environment const& env)
const {
75 environment = std::make_shared<storm::solver::GurobiEnvironment>();
81template<
typename ValueType>
86template<
typename ValueType>
88 std::string
const& name)
const {
89 return std::unique_ptr<storm::solver::LpSolver<ValueType, true>>(
93template<
typename ValueType>
95 return std::make_unique<GurobiLpSolverFactory<ValueType>>(*this);
98template<
typename ValueType>
103template<
typename ValueType>
108template<
typename ValueType>
110 return std::make_unique<Z3LpSolverFactory<ValueType>>(*this);
113template<
typename ValueType>
115 storm::solver::LpSolverType t;
116 if (solvType == storm::solver::LpSolverTypeSelection::FROMSETTINGS) {
120 t = storm::solver::LpSolverType::Z3;
123 t = convert(solvType);
126 case storm::solver::LpSolverType::Glpk:
128 case storm::solver::LpSolverType::Gurobi:
130 case storm::solver::LpSolverType::Highs:
131 if constexpr (std::is_same_v<ValueType, double>) {
134 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"The HiGHS LP solver only supports double precision.");
137 case storm::solver::LpSolverType::Soplex:
139 case storm::solver::LpSolverType::Z3:
145template<
typename ValueType>
147 storm::solver::LpSolverTypeSelection solvType) {
149 return factory->create(env, name);
152template<
typename ValueType>
154 storm::solver::LpSolverTypeSelection solvType) {
156 return factory->createRaw(env, name);
161 switch (smtSolverType) {
162 case storm::solver::SmtSolverType::Z3:
164 case storm::solver::SmtSolverType::Mathsat:
166 case storm::solver::SmtSolverType::Cvc5:
175#ifdef STORM_DEFAULT_SMT_SOLVER_Z3
176 return createSmtSolver(storm::solver::SmtSolverType::Z3, manager);
177#elif defined STORM_DEFAULT_SMT_SOLVER_MATHSAT
178 return createSmtSolver(storm::solver::SmtSolverType::Mathsat, manager);
179#elif defined STORM_DEFAULT_SMT_SOLVER_CVC5
180 return createSmtSolver(storm::solver::SmtSolverType::Cvc5, manager);
216 std::unique_ptr<storm::utility::solver::SmtSolverFactory> factory = std::make_unique<SmtSolverFactory>();
217 return factory->create(manager);
221 std::unique_ptr<storm::utility::solver::SmtSolverFactory> factory = std::make_unique<SmtSolverFactory>();
222 return factory->create(env, manager);
225template class LpSolverFactory<double>;
226template class LpSolverFactory<storm::RationalNumber>;
227template class GlpkLpSolverFactory<double>;
228template class GlpkLpSolverFactory<storm::RationalNumber>;
229template class GurobiLpSolverFactory<double>;
230template class GurobiLpSolverFactory<storm::RationalNumber>;
231template class Z3LpSolverFactory<double>;
232template class Z3LpSolverFactory<storm::RationalNumber>;
233template class SoplexLpSolverFactory<double>;
234template class SoplexLpSolverFactory<storm::RationalNumber>;
235template class HighsLpSolverFactory<double>;
239 storm::solver::LpSolverTypeSelection solvType);
241 storm::solver::LpSolverTypeSelection solvType);
243 storm::solver::LpSolverTypeSelection solvType);
245 storm::solver::LpSolverTypeSelection solvType);
247 storm::solver::LpSolverTypeSelection solvType);
SolverEnvironment & solver()
GlpkSolverEnvironment & glpk()
bool isLpSolverTypeSetFromDefaultValue() const
bool isForceExact() const
storm::solver::LpSolverType const & getLpSolverType() const
GurobiSolverEnvironment & gurobi()
storm::solver::SmtSolverType const & getSmtSolverType() const
Retrieves the SMT solver that is currently selected.
This class is responsible for managing a set of typed variables and all expressions using these varia...
A class that implements the LpSolver interface using glpk as the background solver.
A class that implements the LpSolver interface using Gurobi.
A class that implements the LpSolver interface using HiGHS.
A class that implements the LpSolver interface using Z3.
virtual std::unique_ptr< storm::solver::SmtSolver > create(storm::expressions::ExpressionManager &manager) const
Creates a new SMT solver instance.
virtual std::unique_ptr< storm::solver::LpSolver< ValueType, false > > create(storm::Environment const &env, std::string const &name) const override
Creates a new linear equation solver instance with the given name.
virtual std::unique_ptr< LpSolverFactory< ValueType > > clone() const override
virtual std::unique_ptr< storm::solver::LpSolver< ValueType, true > > createRaw(storm::Environment const &env, std::string const &name) const override
virtual std::unique_ptr< storm::solver::LpSolver< ValueType, true > > createRaw(storm::Environment const &env, std::string const &name) const override
virtual std::unique_ptr< storm::solver::LpSolver< ValueType, false > > create(storm::Environment const &env, std::string const &name) const override
Creates a new linear equation solver instance with the given name.
virtual std::unique_ptr< LpSolverFactory< ValueType > > clone() const override
virtual std::unique_ptr< storm::solver::LpSolver< ValueType, true > > createRaw(storm::Environment const &env, std::string const &name) const override
virtual std::unique_ptr< LpSolverFactory< ValueType > > clone() const override
virtual std::unique_ptr< storm::solver::LpSolver< ValueType, false > > create(storm::Environment const &env, std::string const &name) const override
Creates a new linear equation solver instance with the given name.
virtual std::unique_ptr< storm::solver::SmtSolver > create(storm::expressions::ExpressionManager &manager) const
Creates a new SMT solver instance.
virtual std::unique_ptr< storm::solver::SmtSolver > create(storm::expressions::ExpressionManager &manager) const
Creates a new SMT solver instance.
virtual std::unique_ptr< LpSolverFactory< ValueType > > clone() const override
virtual std::unique_ptr< storm::solver::LpSolver< ValueType, false > > create(storm::Environment const &env, std::string const &name) const override
Creates a new linear equation solver instance with the given name.
virtual std::unique_ptr< storm::solver::LpSolver< ValueType, true > > createRaw(storm::Environment const &env, std::string const &name) const override
virtual std::unique_ptr< LpSolverFactory< ValueType > > clone() const override
virtual std::unique_ptr< storm::solver::LpSolver< ValueType, false > > create(storm::Environment const &env, std::string const &name) const override
Creates a new linear equation solver instance with the given name.
virtual std::unique_ptr< storm::solver::LpSolver< ValueType, true > > createRaw(storm::Environment const &env, std::string const &name) const override
virtual std::unique_ptr< storm::solver::SmtSolver > create(storm::expressions::ExpressionManager &manager) const
Creates a new SMT solver instance.
#define STORM_LOG_THROW_UNCONDITIONALLY(exception, message)
#define STORM_LOG_THROW(cond, exception, message)
std::unique_ptr< LpSolverFactory< ValueType > > getLpSolverFactory(storm::Environment const &env, storm::solver::LpSolverTypeSelection solvType)
std::unique_ptr< storm::solver::LpSolver< ValueType, true > > getRawLpSolver(storm::Environment const &env, std::string const &name, storm::solver::LpSolverTypeSelection solvType)
std::unique_ptr< storm::solver::SmtSolver > getSmtSolver(storm::expressions::ExpressionManager &manager)
std::unique_ptr< storm::solver::LpSolver< ValueType > > getLpSolver(storm::Environment const &env, std::string const &name, storm::solver::LpSolverTypeSelection solvType)
static const bool IsExact