10#include "storm-config.h"
12#ifdef STORM_HAVE_HIGHS
25template<
typename ValueType,
bool RawMode = false>
66 std::optional<ValueType>
const& upperBound = std::nullopt, ValueType objectiveFunctionCoefficient = 0)
override;
69 virtual void update()
const override;
76 virtual void optimize()
const override;
90 virtual void push()
override;
91 virtual void pop()
override;
94 virtual ValueType
getMILPGap(
bool relative)
const override;
97#ifdef STORM_HAVE_HIGHS
101 double toHighsBound(
double value)
const;
107 uint64_t nextVariableIndex;
110 std::map<storm::expressions::Variable, uint64_t> variableToIndexMap;
114 std::vector<std::pair<double, double>> variableBounds;
117 mutable HighsModelStatus modelStatus;
virtual void optimize() const override
Optimizes the LP problem previously constructed.
virtual void update() const override
Updates the model to make the variables that have been declared since the last call to update usable.
HighsLpSolver(std::string const &name, OptimizationDirection const &optDir)
Constructs a solver with the given name and model sense.
virtual void addConstraint(std::string const &name, Constraint const &constraint) override
Adds a the given constraint to the LP problem.
virtual void setMaximalMILPGap(ValueType const &gap, bool relative) override
Specifies the maximum difference between lower- and upper objective bounds that triggers termination.
typename LpSolver< ValueType, RawMode >::Constraint Constraint
virtual void pop() override
Pops a backtracking point from the solver's stack.
typename LpSolver< ValueType, RawMode >::Constant Constant
virtual int_fast64_t getIntegerValue(Variable const &variable) const override
Retrieves the value of the integer variable with the given name.
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) override
typename LpSolver< ValueType, RawMode >::Variable Variable
virtual ValueType getMILPGap(bool relative) const override
Returns the obtained gap after a call to optimize().
virtual void writeModelToFile(std::string const &filename) const override
Writes the current LP problem to the given file.
virtual void addIndicatorConstraint(std::string const &name, Variable indicatorVariable, bool indicatorValue, Constraint const &constraint) override
Adds the given indicator constraint to the LP problem: "If indicatorVariable == indicatorValue,...
HighsLpSolver()
Constructs a solver without a name.
virtual void push() override
Pushes a backtracking point on the solver's stack.
typename LpSolver< ValueType, RawMode >::VariableType VariableType
virtual bool isOptimal() const override
Retrieves whether the model was found to be optimal, i.e.
virtual bool getBinaryValue(Variable const &variable) const override
Retrieves the value of the binary variable with the given name.
virtual bool isInfeasible() const override
Retrieves whether the model was found to be infeasible.
virtual ValueType getContinuousValue(Variable const &variable) const override
Retrieves the value of the continuous variable with the given name.
virtual ValueType getObjectiveValue() const override
Retrieves the value of the objective function.
virtual bool isUnbounded() const override
Retrieves whether the model was found to be infeasible.
std::conditional_t< RawMode, RawLpConstraint< ValueType >, storm::expressions::Expression > Constraint
std::conditional_t< RawMode, ValueType, storm::expressions::Expression > Constant
std::conditional_t< RawMode, typename RawLpConstraint< ValueType >::VariableIndexType, storm::expressions::Variable > Variable
VariableType
Enumerates the different types of variables.
ViOperator LraDistributionEquations Highs