134 #ifndef OR_TOOLS_LINEAR_SOLVER_LINEAR_SOLVER_H_ 135 #define OR_TOOLS_LINEAR_SOLVER_LINEAR_SOLVER_H_ 137 #include <functional> 145 #include "absl/container/flat_hash_map.h" 146 #include "absl/strings/match.h" 147 #include "absl/strings/str_format.h" 148 #include "absl/types/optional.h" 149 #include "ortools/base/commandlineflags.h" 150 #include "ortools/base/integral_types.h" 151 #include "ortools/base/logging.h" 152 #include "ortools/base/macros.h" 153 #include "ortools/base/status.h" 154 #include "ortools/base/timer.h" 155 #include "ortools/glop/parameters.pb.h" 156 #include "ortools/linear_solver/linear_expr.h" 158 #include "ortools/port/proto_utils.h" 189 GLPK_LINEAR_PROGRAMMING = 1,
197 GUROBI_LINEAR_PROGRAMMING = 6,
201 CPLEX_LINEAR_PROGRAMMING = 10,
212 GLPK_MIXED_INTEGER_PROGRAMMING = 4,
218 #if defined(USE_GUROBI) 220 GUROBI_MIXED_INTEGER_PROGRAMMING = 7,
222 #if defined(USE_CPLEX) 224 CPLEX_MIXED_INTEGER_PROGRAMMING = 11,
256 const std::string&
Name()
const {
264 return problem_type_;
283 const std::vector<MPVariable*>&
variables()
const {
return variables_; }
300 const std::string& name);
331 void MakeVarArray(
int nb,
double lb,
double ub,
bool integer,
332 const std::string& name_prefix,
333 std::vector<MPVariable*>* vars);
338 void MakeNumVarArray(
int nb,
double lb,
double ub,
const std::string& name,
339 std::vector<MPVariable*>* vars);
344 void MakeIntVarArray(
int nb,
double lb,
double ub,
const std::string& name,
345 std::vector<MPVariable*>* vars);
351 std::vector<MPVariable*>* vars);
363 const std::vector<MPConstraint*>&
constraints()
const {
return constraints_; }
373 const std::string& constraint_name)
const;
394 const std::string& name);
410 const std::string& name);
462 void Write(
const std::string& file_name);
519 std::string* error_message);
528 const MPModelProto& input_model, std::string* error_message);
602 std::string* model_str)
const;
632 return solver_specific_parameter_string_;
648 void SetHint(std::vector<std::pair<const MPVariable*, double> > hint);
674 const std::vector<MPSolver::BasisStatus>& variable_statuses,
675 const std::vector<MPSolver::BasisStatus>& constraint_statuses);
682 static double infinity() {
return std::numeric_limits<double>::infinity(); }
698 absl::Duration
TimeLimit()
const {
return time_limit_; }
705 return absl::Now() - construction_time_;
785 return time_limit_ == absl::InfiniteDuration()
787 : absl::ToInt64Milliseconds(time_limit_);
791 ? absl::InfiniteDuration()
792 : absl::Milliseconds(time_limit_milliseconds));
795 return static_cast<double>(
time_limit()) / 1000.0;
823 int ComputeMaxConstraintSize(
int min_constraint_index,
824 int max_constraint_index)
const;
827 bool HasInfeasibleConstraints()
const;
830 bool HasIntegerVariables()
const;
833 void GenerateVariableNameIndex()
const;
836 void GenerateConstraintNameIndex()
const;
839 const std::string name_;
845 std::unique_ptr<MPSolverInterface> interface_;
848 std::vector<MPVariable*> variables_;
850 mutable absl::optional<absl::flat_hash_map<std::string, int> >
851 variable_name_to_index_;
853 std::vector<bool> variable_is_extracted_;
856 std::vector<MPConstraint*> constraints_;
858 mutable absl::optional<absl::flat_hash_map<std::string, int> >
859 constraint_name_to_index_;
861 std::vector<bool> constraint_is_extracted_;
864 std::unique_ptr<MPObjective> objective_;
873 std::vector<std::pair<const MPVariable*, double> > solution_hint_;
875 absl::Duration time_limit_ = absl::InfiniteDuration();
877 const absl::Time construction_time_;
880 int num_threads_ = 1;
883 std::string solver_specific_parameter_string_;
887 std::string* error_message);
898 return os <<
ToString(optimization_problem_type);
903 return os << ProtoEnumToString<MPSolverResponseStatus>(
904 static_cast<MPSolverResponseStatus>(status));
913 return std::string(
ToString(solver_type));
947 const absl::flat_hash_map<const MPVariable *, double> &
terms()
const {
948 return coefficients_;
959 double offset()
const {
return offset_; }
1020 double Value()
const;
1051 : interface_(interface_in), coefficients_(1), offset_(0.0) {}
1056 absl::flat_hash_map<const MPVariable*, double> coefficients_;
1071 const std::string&
name()
const {
return name_; }
1100 double lb()
const {
return lb_; }
1105 double ub()
const {
return ub_; }
1180 name_(
name.empty() ? absl::StrFormat(
"auto_v_%09d",
index) :
name),
1181 solution_value_(0.0),
1183 interface_(interface_in) {}
1193 const std::string name_;
1194 double solution_value_;
1195 double reduced_cost_;
1196 int branching_priority_ = 0;
1211 const std::string&
name()
const {
return name_; }
1237 const absl::flat_hash_map<const MPVariable*, double>&
terms()
const {
1238 return coefficients_;
1244 double lb()
const {
return lb_; }
1249 double ub()
const {
return ub_; }
1337 name_(
name.empty() ? absl::StrFormat(
"auto_c_%09d",
index) :
name),
1339 indicator_variable_(nullptr),
1341 interface_(interface_in) {}
1348 bool ContainsNewVariables();
1351 absl::flat_hash_map<const MPVariable*, double> coefficients_;
1362 const std::string name_;
1372 bool indicator_value_;
1566 double relative_mip_gap_value_;
1567 double primal_tolerance_value_;
1568 double dual_tolerance_value_;
1569 int presolve_value_;
1571 int lp_algorithm_value_;
1572 int incrementality_value_;
1578 bool lp_algorithm_is_default_;
1626 virtual void Write(
const std::string& filename);
1630 virtual void Reset() = 0;
1650 LOG(ERROR) <<
"Solver doesn't support indicator constraints.";
1660 double new_value,
double old_value) = 0;
1667 double coefficient) = 0;
1682 virtual int64
nodes()
const = 0;
1721 virtual bool IsLP()
const = 0;
1723 virtual bool IsMIP()
const = 0;
1729 return solver_->variable_is_extracted_[var_index];
1732 solver_->variable_is_extracted_[var_index] = extracted;
1735 return solver_->constraint_is_extracted_[ct_index];
1738 solver_->constraint_is_extracted_[ct_index] = extracted;
1764 const std::vector<MPSolver::BasisStatus>& variable_statuses,
1765 const std::vector<MPSolver::BasisStatus>& constraint_statuses) {
1766 LOG(FATAL) <<
"Not supported by this solver.";
1854 const std::string& parameters);
1872 #endif // OR_TOOLS_LINEAR_SOLVER_LINEAR_SOLVER_H_ util::Status LoadSolutionFromProto(const MPSolutionResponse &response, double tolerance=kDefaultPrimalTolerance)
Load a solution encoded in a protocol buffer onto this solver for easy access via the MPSolver interf...
Advanced usage: incrementality from one solve to the next.
friend class SLMInterface
virtual util::Status SetNumThreads(int num_threads)
double GetCoefficient(const MPVariable *const var) const
Gets the coefficient of a given variable in the objective.
double GetCoefficient(const MPVariable *const var) const
Gets the coefficient of a given variable on the constraint (which is 0 if the variable does not appea...
virtual void ClearObjective()=0
virtual MPSolver::BasisStatus column_status(int variable_index) const =0
bool integer() const
Returns the integrality requirement of the variable.
void SetIntegerParam(MPSolverParameters::IntegerParam param, int value)
Sets a integer parameter to a specific value.
void set_variable_as_extracted(int var_index, bool extracted)
friend class KnapsackInterface
MPSolver::ResultStatus result_status_
void * underlying_solver()
Advanced usage: returns the underlying solver.
friend class SatInterface
virtual void SetIntegerParamToUnsupportedValue(MPSolverParameters::IntegerParam param, int value)
friend class SCIPInterface
friend class CplexInterface
int branching_priority() const
Advanced usage: Certain MIP solvers (e.g.
void Clear()
Clears the offset, all variables and coefficients, and the optimization direction.
double time_limit_in_secs() const
IntegerParam
Enumeration of parameters that take integer or categorical values.
This mathematical programming (MP) solver class is the main class though which users build and solve ...
friend class CBCInterface
void SetCommonParameters(const MPSolverParameters ¶m)
virtual bool IsLP() const =0
const std::vector< MPVariable * > & variables() const
Returns the array of variables handled by the MPSolver.
void SetLB(double lb)
Sets the lower bound.
double reduced_cost() const
Advanced usage: returns the reduced cost of the variable in the current solution (only available for ...
void SetBounds(double lb, double ub)
Sets both the lower and upper bounds.
int64 iterations() const
Returns the number of simplex iterations.
const absl::flat_hash_map< const MPVariable *, double > & terms() const
Returns a map from variables to their coefficients in the constraint.
Advanced usage: presolve mode.
MPVariable * LookupVariableOrNull(const std::string &var_name) const
Looks up a variable by name, and returns nullptr if it does not exist.
static const int kDefaultIntegerParamValue
virtual void Write(const std::string &filename)
void SetHint(std::vector< std::pair< const MPVariable *, double > > hint)
Set a hint for solution.
the model is trivially invalid (NaN coefficients, etc).
void MakeBoolVarArray(int nb, const std::string &name, std::vector< MPVariable * > *vars)
Creates an array of boolean variables.
friend class GurobiInterface
virtual bool InterruptSolve()
friend class SatInterface
MPSolver(const std::string &name, OptimizationProblemType problem_type)
Create a solver with the given name and underlying solver backend.
virtual double best_objective_bound() const =0
void set_is_lazy(bool laziness)
Advanced usage: sets the constraint "laziness".
virtual void SetUnsupportedIntegerParam(MPSolverParameters::IntegerParam param)
Mixed integer Programming Solver using Coin CBC.
virtual MPSolver::ResultStatus Solve(const MPSolverParameters ¶m)=0
friend class CBCInterface
const std::string & name() const
Returns the name of the variable.
bool is_lazy() const
Advanced usage: returns true if the constraint is "lazy" (see below).
static bool ParseSolverType(absl::string_view solver, OptimizationProblemType *type)
Parses the name of the solver.
friend class BopInterface
double offset() const
Gets the constant term in the objective.
const MPObjective & Objective() const
Returns the objective object.
int last_constraint_index_
void set_solution_value(double value)
friend class CplexInterface
void SetCoefficient(const MPVariable *const var, double coeff)
Sets the coefficient of the variable in the objective.
void SetOptimizationDirection(bool maximize)
Sets the optimization direction (maximize: true or minimize: false).
bool variable_is_extracted(int var_index) const
friend class GurobiInterface
friend class SLMInterface
virtual bool AddIndicatorConstraint(MPConstraint *const ct)
bool constraint_is_extracted(int ct_index) const
IncrementalityValues
Advanced usage: Incrementality options.
int index() const
Returns the index of the constraint in the MPSolver::constraints_.
friend class SCIPInterface
friend class GurobiInterface
void SetStartingLpBasis(const std::vector< MPSolver::BasisStatus > &variable_statuses, const std::vector< MPSolver::BasisStatus > &constraint_statuses)
Advanced usage: Incrementality.
friend class GLPKInterface
static const double kDefaultDoubleParamValue
Reuse results from previous solve as much as the underlying solver allows.
bool ExportModelAsMpsFormat(bool fixed_format, bool obfuscate, std::string *model_str) const
void SetBranchingPriority(int priority)
double trivial_worst_objective_bound() const
friend class KnapsackInterface
MPVariable * MakeIntVar(double lb, double ub, const std::string &name)
Creates an integer variable.
virtual void SetCoefficient(MPConstraint *const constraint, const MPVariable *const variable, double new_value, double old_value)=0
void Clear()
Clears the objective (including the optimization direction), all variables and constraints.
friend class SCIPInterface
friend class CLPInterface
friend class BopInterface
friend class BopInterface
virtual void SetScalingMode(int value)=0
friend class SCIPInterface
constexpr double kDefaultPrimalTolerance
int NumVariables() const
Returns the number of variables.
friend class CBCInterface
double dual_value() const
Advanced usage: returns the dual value of the constraint in the current solution (only available for ...
virtual void SetDualTolerance(double value)=0
void SetCoefficient(const MPVariable *const var, double coeff)
Sets the coefficient of the variable on the constraint.
virtual std::string SolverVersion() const =0
static const double kDefaultPrimalTolerance
virtual void * underlying_solver()=0
static void SolveWithProto(const MPModelRequest &model_request, MPSolutionResponse *response)
Solves the model encoded by a MPModelRequest protocol buffer and fills the solution encoded as a MPSo...
MPSolver::ResultStatus result_status() const
virtual std::string ValidFileExtensionForParameterFile() const
PresolveValues
For each categorical parameter, enumeration of possible values.
friend class MPVariableSolutionValueTest
const MPVariable * indicator_variable() const
MPObjective * MutableObjective()
Returns the mutable objective object.
void ExportModelToProto(MPModelProto *output_model) const
Exports model to protocol buffer.
void OptimizeLinearExpr(const LinearExpr &linear_expr, bool is_maximization)
Resets the current objective to take the value of linear_expr, and sets the objective direction to ma...
void EnableOutput()
Enable output.
virtual void SetObjectiveCoefficient(const MPVariable *const variable, double coefficient)=0
int GetIntegerParam(MPSolverParameters::IntegerParam param) const
Returns the value of an integer parameter.
void SetMaximization()
Sets the optimization direction to maximize.
void SetDoubleParamToUnsupportedValue(MPSolverParameters::DoubleParam param, double value)
friend class GLPKInterface
friend class GLPKInterface
double objective_value() const
const absl::flat_hash_map< const MPVariable *, double > & terms() const
Returns a map from variables to their coefficients in the objective.
bool SetSolverSpecificParametersAsString(const std::string ¶meters)
Advanced usage: pass solver specific parameters in text format.
Mixed integer Programming Solver using SCIP.
static const IncrementalityValues kDefaultIncrementality
virtual int64 nodes() const =0
ABSL_MUST_USE_RESULT bool NextSolution()
Some solvers (MIP only, not LP) can produce multiple solutions to the problem.
bool CheckSolutionIsSynchronized() const
friend class CplexInterface
void MakeIntVarArray(int nb, double lb, double ub, const std::string &name, std::vector< MPVariable * > *vars)
Creates an array of integer variables.
virtual bool IsMIP() const =0
virtual void ExtractNewVariables()=0
virtual void ClearConstraint(MPConstraint *const constraint)=0
void Write(const std::string &file_name)
Writes the model using the solver internal write function.
MPSolver::BasisStatus basis_status() const
Advanced usage: returns the basis status of the variable in the current solution (only available for ...
bool indicator_value() const
virtual OptimizationProblemType ProblemType() const
Returns the optimization problem type set at construction.
friend class SLMInterface
void SuppressOutput()
Suppress output.
void Clear()
Clears all variables and coefficients.
friend class SatInterface
bool CheckSolutionIsSynchronizedAndExists() const
void set_constraint_as_extracted(int ct_index, bool extracted)
void SetTimeLimit(absl::Duration time_limit)
MPSolverResponseStatus LoadModelFromProtoWithUniqueNamesOrDie(const MPModelProto &input_model, std::string *error_message)
Loads model from protocol buffer.
friend class GLOPInterface
friend class GLOPInterface
static bool SupportsProblemType(OptimizationProblemType problem_type)
Whether the given problem type is supported (this will depend on the targets that you linked).
double ComputeExactConditionNumber() const
Advanced usage: computes the exact condition number of the current scaled basis: L1norm(B) * L1norm(i...
bool minimization() const
Is the optimization direction set to minimize?
friend class CLPInterface
virtual void SetOptimizationDirection(bool maximize)=0
void InvalidateSolutionSynchronization()
void AddLinearExpr(const LinearExpr &linear_expr)
Adds linear_expr to the current objective, does not change the direction.
void SetMinimization()
Sets the optimization direction to minimize.
void MinimizeLinearExpr(const LinearExpr &linear_expr)
Resets the current objective to minimize linear_expr.
std::ostream & operator<<(std::ostream &os, MPSolver::OptimizationProblemType optimization_problem_type)
void MakeNumVarArray(int nb, double lb, double ub, const std::string &name, std::vector< MPVariable * > *vars)
Creates an array of continuous variables.
virtual bool CheckBestObjectiveBoundExists() const
bool VerifySolution(double tolerance, bool log_errors) const
Advanced usage: Verifies the correctness of the solution.
void ResetIntegerParam(MPSolverParameters::IntegerParam param)
Sets an integer parameter to its default value (default value defined in MPSolverParameters if it exi...
virtual bool SetSolverSpecificParametersAsString(const std::string ¶meters)
Start solve from scratch.
int64 nodes() const
Returns the number of branch-and-bound nodes evaluated during the solve.
Linear Programming solver using GLOP (Recommended solver).
static double infinity()
Infinity.
friend class CLPInterface
bool OwnsVariable(const MPVariable *var) const
virtual void AddVariable(MPVariable *const var)=0
void MakeVarArray(int nb, double lb, double ub, bool integer, const std::string &name_prefix, std::vector< MPVariable * > *vars)
Creates an array of variables.
virtual void SetVariableBounds(int index, double lb, double ub)=0
void SetLB(double lb)
Sets the lower bound.
friend class CBCInterface
void SetMIPParameters(const MPSolverParameters ¶m)
void SetInteger(bool integer)
Sets the integrality requirement of the variable.
virtual void ExtractObjective()=0
virtual void SetPrimalTolerance(double value)=0
friend class CLPInterface
void set_time_limit(int64 time_limit_milliseconds)
ResultStatus Solve()
Solves the problem using default parameter values.
MPConstraint * MakeRowConstraint()
Creates a constraint with -infinity and +infinity bounds.
void SetDoubleParam(MPSolverParameters::DoubleParam param, double value)
Sets a double parameter to a specific value.
OptimizationProblemType
The type of problems (LP or MIP) that will be solved and the underlying solver (GLOP,...
virtual bool NextSolution()
const std::string & Name() const
Returns the name of the model set at construction.
MPSolverParameters()
The constructor sets all parameters to their default value.
Algorithm to solve linear programs.
const absl::string_view ToString(MPSolver::OptimizationProblemType optimization_problem_type)
BasisStatus
Advanced usage: possible basis status values for a variable and the slack variable of a linear constr...
MPSolver::BasisStatus basis_status() const
Advanced usage: returns the basis status of the constraint.
ResultStatus
The status of solving the problem.
Advanced usage: tolerance for primal feasibility of basic solutions.
virtual void SetVariableInteger(int index, bool integer)=0
double BestBound() const
Returns the best objective bound.
static const int kUnknownIntegerParamValue
virtual void ExtractNewConstraints()=0
virtual MPSolver::BasisStatus row_status(int constraint_index) const =0
double ub() const
Returns the upper bound.
This class stores parameter settings for LP and MIP solvers.
const std::string & name() const
Returns the name of the constraint.
friend class SatInterface
LpAlgorithmValues
LP algorithm to use.
The class for constraints of a Mathematical Programming (MP) model.
virtual void BranchingPriorityChangedForVariable(int var_index)
int NumConstraints() const
Returns the number of constraints.
friend class KnapsackInterface
friend class GurobiInterface
void set_dual_value(double dual_value)
double unrounded_solution_value() const
Advanced usage: unrounded solution value.
std::vector< double > ComputeConstraintActivities() const
Advanced usage: compute the "activities" of all constraints, which are the sums of their linear terms...
util::Status SetNumThreads(int num_threads)
Sets the number of threads to use by the underlying solver.
ScalingValues
Advanced usage: Scaling options.
std::string AbslUnparseFlag(MPSolver::OptimizationProblemType solver_type)
bool AbslParseFlag(absl::string_view text, MPSolver::OptimizationProblemType *solver_type, std::string *error)
abnormal, i.e., error of some kind.
MPVariable(int index, double lb, double ub, bool integer, const std::string &name, MPSolverInterface *const interface_in)
void SetUB(double ub)
Sets the upper bound.
bool ExportModelAsLpFormat(bool obfuscate, std::string *model_str) const
Shortcuts to the homonymous MPModelProtoExporter methods, via exporting to a MPModelProto with Export...
static const double kUnknownDoubleParamValue
void Reset()
Sets all parameters to their default value.
static const int64 kUnknownNumberOfIterations
absl::Duration DurationSinceConstruction() const
friend class CplexInterface
void ResetDoubleParam(MPSolverParameters::DoubleParam param)
Sets a double parameter to its default value (default value defined in MPSolverParameters if it exist...
friend class KnapsackInterface
MPSolverResponseStatus LoadModelFromProto(const MPModelProto &input_model, std::string *error_message)
Loads model from protocol buffer.
virtual void AddRowConstraint(MPConstraint *const ct)=0
Linear Programming solver using Coin CBC.
std::string SolverVersion() const
Returns a std::string describing the underlying solver and its version.
virtual double ComputeExactConditionNumber() const
MPVariable * MakeNumVar(double lb, double ub, const std::string &name)
Creates a continuous variable.
virtual ~MPSolverInterface()
MPConstraint(int index, double lb, double ub, const std::string &name, MPSolverInterface *const interface_in)
MPSolverInterface(MPSolver *const solver)
void SetUnsupportedDoubleParam(MPSolverParameters::DoubleParam param)
MPVariable * MakeBoolVar(const std::string &name)
Creates a boolean variable.
friend class GLOPInterface
bool maximization() const
Is the optimization direction set to maximize?
int GetNumThreads() const
Returns the number of threads to be used during solve.
MPConstraint * LookupConstraintOrNull(const std::string &constraint_name) const
Looks up a constraint by name, and returns nullptr if it does not exist.
virtual void SetObjectiveOffset(double value)=0
void set_quiet(bool quiet_value)
The class for variables of a Mathematical Programming (MP) model.
Linear Boolean Programming Solver.
virtual bool ReadParameterFile(const std::string &filename)
void SetBounds(double lb, double ub)
Sets both the lower and upper bounds.
Advanced usage: tolerance for dual feasibility of basic solutions.
virtual void SetPresolveMode(int value)=0
virtual void SetParameters(const MPSolverParameters ¶m)=0
static const int kDummyVariableIndex
friend class GLPKInterface
double ub() const
Returns the upper bound.
MPVariable * MakeVar(double lb, double ub, bool integer, const std::string &name)
Creates a variable with the given bounds, integrality requirement and name.
void MaximizeLinearExpr(const LinearExpr &linear_expr)
Resets the current objective to maximize linear_expr.
util::Status ClampSolutionWithinBounds()
Resets values of out of bound variables to the corresponding bound and returns an error if any of the...
feasible, or stopped by limit.
static const PresolveValues kDefaultPresolve
bool InterruptSolve()
Interrupts the Solve() execution to terminate processing if possible.
Advanced usage: enable or disable matrix scaling.
double GetDoubleParam(MPSolverParameters::DoubleParam param) const
Returns the value of a double parameter.
void SetUB(double ub)
Sets the upper bound.
virtual bool CheckSolutionExists() const
static const double kDefaultRelativeMipGap
double lb() const
Returns the lower bound.
std::string GetSolverSpecificParametersAsString() const
int last_variable_index() const
void FillSolutionResponseProto(MPSolutionResponse *response) const
Encodes the current solution in a solution response protocol buffer.
static const double kDefaultDualTolerance
const std::vector< MPConstraint * > & constraints() const
Returns the array of constraints handled by the MPSolver.
Limit for relative MIP gap.
DoubleParam
Enumeration of parameters that take continuous values.
void ResetExtractionInformation()
virtual int64 iterations() const =0
bool OutputIsEnabled() const
Controls (or queries) the amount of output produced by the underlying solver.
double lb() const
Returns the lower bound.
static const int64 kUnknownNumberOfNodes
double solution_value() const
Returns the value of the variable in the current solution.
void set_reduced_cost(double reduced_cost)
void SetOffset(double value)
Sets the constant term in the objective.
absl::Duration TimeLimit() const
virtual void SetRelativeMipGap(double value)=0
friend class SLMInterface
int index() const
Returns the index of the variable in the MPSolver::variables_.
A class to express a linear objective.
friend class GLOPInterface
virtual void SetConstraintBounds(int index, double lb, double ub)=0
SynchronizationStatus sync_status_
friend class BopInterface
virtual bool IsContinuous() const =0
virtual void SetLpAlgorithm(int value)=0
virtual void SetStartingLpBasis(const std::vector< MPSolver::BasisStatus > &variable_statuses, const std::vector< MPSolver::BasisStatus > &constraint_statuses)
void Reset()
Advanced usage: resets extracted model to solve from scratch.
double Value() const
Returns the objective value of the best solution found so far.