24template<
typename ValueType>
26 return std::unique_ptr<storm::solver::LpSolver<ValueType>>(
30template<
typename ValueType>
32 std::string
const& name)
const {
33 return std::unique_ptr<storm::solver::LpSolver<ValueType, true>>(
37template<
typename ValueType>
39 return std::make_unique<GlpkLpSolverFactory<ValueType>>(*this);
42template<
typename ValueType>
47template<
typename ValueType>
49 std::string
const& name)
const {
53template<
typename ValueType>
55 return std::make_unique<SoplexLpSolverFactory<ValueType>>(*this);
58template<
typename ValueType>
63template<
typename ValueType>
68template<
typename ValueType>
70 return std::make_unique<HighsLpSolverFactory<ValueType>>(*this);
73template<
typename ValueType>
74std::shared_ptr<storm::solver::GurobiEnvironment>
const& GurobiLpSolverFactory<ValueType>::getOrCreateGurobiEnvironment(
storm::Environment const& env)
const {
76 environment = std::make_shared<storm::solver::GurobiEnvironment>();
82template<
typename ValueType>
87template<
typename ValueType>
89 std::string
const& name)
const {
90 return std::unique_ptr<storm::solver::LpSolver<ValueType, true>>(
94template<
typename ValueType>
96 return std::make_unique<GurobiLpSolverFactory<ValueType>>(*this);
99template<
typename ValueType>
104template<
typename ValueType>
109template<
typename ValueType>
111 return std::make_unique<Z3LpSolverFactory<ValueType>>(*this);
114template<
typename ValueType>
116 storm::solver::LpSolverType t;
117 if (solvType == storm::solver::LpSolverTypeSelection::FROMSETTINGS) {
121 t = storm::solver::LpSolverType::Z3;
124 t = convert(solvType);
127 case storm::solver::LpSolverType::Glpk:
129 case storm::solver::LpSolverType::Gurobi:
131 case storm::solver::LpSolverType::Highs:
132 if constexpr (std::is_same_v<ValueType, double>) {
135 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);
160 storm::solver::SmtSolverType smtSolverType;
165 smtSolverType = storm::solver::SmtSolverType::Z3;
166#elif defined STORM_HAVE_MATHSAT
167 smtSolverType = storm::solver::SmtSolverType::Mathsat;
169 STORM_LOG_THROW(
false, storm::exceptions::MissingLibraryException,
"Requested an SMT solver but none was installed.");
172 switch (smtSolverType) {
173 case storm::solver::SmtSolverType::Z3:
175 case storm::solver::SmtSolverType::Mathsat:
190 std::unique_ptr<storm::utility::solver::SmtSolverFactory> factory = std::make_unique<SmtSolverFactory>();
191 return factory->create(manager);
194template class LpSolverFactory<double>;
195template class LpSolverFactory<storm::RationalNumber>;
196template class GlpkLpSolverFactory<double>;
197template class GlpkLpSolverFactory<storm::RationalNumber>;
198template class GurobiLpSolverFactory<double>;
199template class GurobiLpSolverFactory<storm::RationalNumber>;
200template class Z3LpSolverFactory<double>;
201template class Z3LpSolverFactory<storm::RationalNumber>;
202template class SoplexLpSolverFactory<double>;
203template class SoplexLpSolverFactory<storm::RationalNumber>;
204template class HighsLpSolverFactory<double>;
208 storm::solver::LpSolverTypeSelection solvType);
210 storm::solver::LpSolverTypeSelection solvType);
212 storm::solver::LpSolverTypeSelection solvType);
214 storm::solver::LpSolverTypeSelection solvType);
216 storm::solver::LpSolverTypeSelection solvType);
SolverEnvironment & solver()
GlpkSolverEnvironment & glpk()
bool isLpSolverTypeSetFromDefaultValue() const
bool isForceExact() const
storm::solver::LpSolverType const & getLpSolverType() const
GurobiSolverEnvironment & gurobi()
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::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(cond, exception, message)
bool hasModule()
Returns true if the given module is registered.
SettingsType const & getModule()
Get module.
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