Storm
A Modern Probabilistic Model Checker
|
#include <GlpkLpSolver.h>
Public Member Functions | |
GlpkLpSolver (std::string const &name, OptimizationDirection const &modelSense) | |
GlpkLpSolver (std::string const &name) | |
GlpkLpSolver (OptimizationDirection const &modelSense) | |
GlpkLpSolver () | |
virtual | ~GlpkLpSolver () |
virtual void | update () const override |
Updates the model to make the variables that have been declared since the last call to update usable. | |
virtual void | addConstraint (std::string const &name, storm::expressions::Expression const &constraint) override |
virtual void | optimize () const override |
Optimizes the LP problem previously constructed. | |
virtual bool | isInfeasible () const override |
Retrieves whether the model was found to be infeasible. | |
virtual bool | isUnbounded () const override |
Retrieves whether the model was found to be infeasible. | |
virtual bool | isOptimal () const override |
Retrieves whether the model was found to be optimal, i.e. | |
virtual ValueType | getContinuousValue (storm::expressions::Variable const &variable) const override |
virtual int_fast64_t | getIntegerValue (storm::expressions::Variable const &variable) const override |
virtual bool | getBinaryValue (storm::expressions::Variable const &variable) const override |
virtual ValueType | getObjectiveValue () const override |
Retrieves the value of the objective function. | |
virtual void | writeModelToFile (std::string const &filename) const override |
Writes the current LP problem to the given file. | |
virtual void | push () override |
Pushes a backtracking point on the solver's stack. | |
virtual void | pop () override |
Pops a backtracking point from the solver's stack. | |
virtual ValueType | getMILPGap (bool relative) const override |
Returns the obtained gap after a call to optimize() | |
virtual ValueType | getMILPGap (bool relative) const override |
Returns the obtained gap after a call to optimize() | |
![]() | |
LpSolver () | |
Creates an empty LP solver. | |
LpSolver (OptimizationDirection const &optDir) | |
Creates an empty LP solver with the given model sense. | |
virtual | ~LpSolver ()=default |
Variable | addBoundedContinuousVariable (std::string const &name, ValueType lowerBound, ValueType upperBound, ValueType objectiveFunctionCoefficient=0) |
Registers an upper- and lower-bounded continuous variable, i.e. | |
Variable | addLowerBoundedContinuousVariable (std::string const &name, ValueType lowerBound, ValueType objectiveFunctionCoefficient=0) |
Registers a lower-bounded continuous variable, i.e. | |
Variable | addUpperBoundedContinuousVariable (std::string const &name, ValueType upperBound, ValueType objectiveFunctionCoefficient=0) |
Registers an upper-bounded continuous variable, i.e. | |
Variable | addUnboundedContinuousVariable (std::string const &name, ValueType objectiveFunctionCoefficient=0) |
Registers a unbounded continuous variable, i.e. | |
Variable | addContinuousVariable (std::string const &name, std::optional< ValueType > const &lowerBound=std::nullopt, std::optional< ValueType > const &upperBound=std::nullopt, ValueType objectiveFunctionCoefficient=0) |
Registers a continuous variable, i.e. | |
Variable | addBoundedIntegerVariable (std::string const &name, ValueType lowerBound, ValueType upperBound, ValueType objectiveFunctionCoefficient=0) |
Registers an upper- and lower-bounded integer variable, i.e. | |
Variable | addLowerBoundedIntegerVariable (std::string const &name, ValueType lowerBound, ValueType objectiveFunctionCoefficient=0) |
Registers a lower-bounded integer variable, i.e. | |
Variable | addUpperBoundedIntegerVariable (std::string const &name, ValueType upperBound, ValueType objectiveFunctionCoefficient=0) |
Registers an upper-bounded integer variable, i.e. | |
Variable | addUnboundedIntegerVariable (std::string const &name, ValueType objectiveFunctionCoefficient=0) |
Registers an unbounded integer variable, i.e. | |
Variable | addIntegerVariable (std::string const &name, std::optional< ValueType > const &lowerBound=std::nullopt, std::optional< ValueType > const &upperBound=std::nullopt, ValueType objectiveFunctionCoefficient=0) |
Registers an integer variable, i.e. | |
Variable | addBinaryVariable (std::string const &name, ValueType objectiveFunctionCoefficient=0) |
Registers a boolean variable, i.e. | |
virtual Variable | addVariable (std::string const &name, VariableType const &type, std::optional< ValueType > const &lowerBound=std::nullopt, std::optional< ValueType > const &upperBound=std::nullopt, ValueType objectiveFunctionCoefficient=0)=0 |
Registers a variable of the given type. | |
Constant | getConstant (ValueType value) const |
Retrieves an expression that characterizes the given constant value. | |
virtual void | addConstraint (std::string const &name, Constraint const &constraint)=0 |
Adds a the given constraint to the LP problem. | |
virtual void | addIndicatorConstraint (std::string const &name, Variable indicatorVariable, bool indicatorValue, Constraint const &constraint)=0 |
Adds the given indicator constraint to the LP problem: "If indicatorVariable == indicatorValue, then constraint". | |
virtual int_fast64_t | getIntegerValue (Variable const &variable) const =0 |
Retrieves the value of the integer variable with the given name. | |
virtual bool | getBinaryValue (Variable const &variable) const =0 |
Retrieves the value of the binary variable with the given name. | |
virtual ValueType | getContinuousValue (Variable const &variable) const =0 |
Retrieves the value of the continuous variable with the given name. | |
void | setOptimizationDirection (OptimizationDirection const &optimizationDirection) |
Sets whether the objective function of this model is to be minimized or maximized. | |
OptimizationDirection | getOptimizationDirection () const |
Retrieves whether the objective function of this model is to be minimized or maximized. | |
storm::expressions::ExpressionManager const & | getManager () const |
Retrieves the manager for the variables created for this solver. | |
virtual void | setMaximalMILPGap (ValueType const &gap, bool relative)=0 |
Specifies the maximum difference between lower- and upper objective bounds that triggers termination. | |
Additional Inherited Members | |
![]() | |
enum class | VariableType { Continuous , Integer , Binary } |
Enumerates the different types of variables. More... | |
using | Variable = std::conditional_t< RawMode, typename RawLpConstraint< ValueType >::VariableIndexType, storm::expressions::Variable > |
using | Constant = std::conditional_t< RawMode, ValueType, storm::expressions::Expression > |
using | Constraint = std::conditional_t< RawMode, RawLpConstraint< ValueType >, storm::expressions::Expression > |
![]() | |
storm::expressions::Variable | declareOrGetExpressionVariable (std::string const &name, VariableType const &type) |
![]() | |
std::shared_ptr< storm::expressions::ExpressionManager > | manager |
bool | currentModelHasBeenOptimized |
Definition at line 122 of file GlpkLpSolver.h.
|
inline |
Definition at line 124 of file GlpkLpSolver.h.
|
inline |
Definition at line 129 of file GlpkLpSolver.h.
|
inline |
Definition at line 134 of file GlpkLpSolver.h.
|
inline |
Definition at line 139 of file GlpkLpSolver.h.
|
inlinevirtual |
Definition at line 144 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Definition at line 154 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Definition at line 189 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Definition at line 179 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Definition at line 184 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Returns the obtained gap after a call to optimize()
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 214 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Returns the obtained gap after a call to optimize()
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 219 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Retrieves the value of the objective function.
Note that this may only be called, if the model was found to be optimal, i.e. iff isOptimal() returns true.
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 194 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Retrieves whether the model was found to be infeasible.
This can only be called after the model has been optimized and not modified afterwards. Otherwise, an exception is thrown.
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 164 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Retrieves whether the model was found to be optimal, i.e.
neither infeasible nor unbounded. This can only be called after the model has been optimized and not modified afterwards. Otherwise, an exception is thrown.
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 174 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Retrieves whether the model was found to be infeasible.
This can only be called after the model has been optimized and not modified afterwards. Otherwise, an exception is thrown.
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 169 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Optimizes the LP problem previously constructed.
Afterwards, the methods isInfeasible, isUnbounded and isOptimal can be used to query the optimality status.
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 159 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Pops a backtracking point from the solver's stack.
This deletes all assertions from the solver's stack that were added after the last call to push().
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 209 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Pushes a backtracking point on the solver's stack.
A following call to pop() deletes exactly those assertions from the solver's stack that were added after this call.
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 204 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Updates the model to make the variables that have been declared since the last call to update
usable.
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 149 of file GlpkLpSolver.h.
|
inlineoverridevirtual |
Writes the current LP problem to the given file.
filename | The file to which to write the string representation of the LP. |
Implements storm::solver::LpSolver< ValueType, RawMode >.
Definition at line 199 of file GlpkLpSolver.h.