#include "LpSolver.h" #include "storm/storage/expressions/Expression.h" #include "storm/storage/expressions/ExpressionManager.h" namespace storm { namespace solver { template LpSolver::LpSolver() : manager(new storm::expressions::ExpressionManager()), currentModelHasBeenOptimized(false), optimizationDirection(OptimizationDirection::Minimize) { // Intentionally left empty. } template LpSolver::LpSolver(OptimizationDirection const& optimizationDir) : manager(new storm::expressions::ExpressionManager()), currentModelHasBeenOptimized(false), optimizationDirection(optimizationDir) { // Intentionally left empty. } template storm::expressions::Variable LpSolver::addContinuousVariable(std::string const& name, boost::optional const& lowerBound, boost::optional const& upperBound, ValueType objectiveFunctionCoefficient) { if (lowerBound) { if (upperBound) { return addBoundedContinuousVariable(name, lowerBound.get(), upperBound.get(), objectiveFunctionCoefficient); } else { return addLowerBoundedContinuousVariable(name, lowerBound.get(), objectiveFunctionCoefficient); } } else { if (upperBound) { return addUpperBoundedContinuousVariable(name, upperBound.get(), objectiveFunctionCoefficient); } else { return addUnboundedContinuousVariable(name, objectiveFunctionCoefficient); } } } template storm::expressions::Variable LpSolver::addIntegerVariable(std::string const& name, boost::optional const& lowerBound, boost::optional const& upperBound, ValueType objectiveFunctionCoefficient) { if (lowerBound) { if (upperBound) { return addBoundedIntegerVariable(name, lowerBound.get(), upperBound.get(), objectiveFunctionCoefficient); } else { return addLowerBoundedIntegerVariable(name, lowerBound.get(), objectiveFunctionCoefficient); } } else { if (upperBound) { return addUpperBoundedIntegerVariable(name, upperBound.get(), objectiveFunctionCoefficient); } else { return addUnboundedIntegerVariable(name, objectiveFunctionCoefficient); } } } template storm::expressions::Expression LpSolver::getConstant(ValueType value) const { return manager->rational(value); } template class LpSolver; template class LpSolver; } }