C++ Reference
C++ Reference: Linear solver
linear_solver.h
Go to the documentation of this file.
464 };
692 };
1432 };
1444 };
1452 };
1462 };
1474 };
1482 };
1585 };
LinearExpr models a quantity that is linear in the decision variables (MPVariable) of an optimization...
Definition: linear_expr.h:114
The class for constraints of a Mathematical Programming (MP) model.
Definition: linear_solver.h:1231
void SetBounds(double lb, double ub)
Sets both the lower and upper bounds.
friend class SCIPInterface
Definition: linear_solver.h:1327
void SetCoefficient(const MPVariable *const var, double coeff)
Sets the coefficient of the variable on the constraint.
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...
const MPVariable * indicator_variable() const
Definition: linear_solver.h:1295
friend class SLMInterface
Definition: linear_solver.h:1328
friend class CLPInterface
Definition: linear_solver.h:1325
const absl::flat_hash_map< const MPVariable *, double > & terms() const
Returns a map from variables to their coefficients in the constraint.
Definition: linear_solver.h:1258
MPConstraint(int index, double lb, double ub, const std::string &name, MPSolverInterface *const interface_in)
Definition: linear_solver.h:1342
friend class GLOPInterface
Definition: linear_solver.h:1332
friend class BopInterface
Definition: linear_solver.h:1333
bool indicator_value() const
Definition: linear_solver.h:1296
friend class PdlpInterface
Definition: linear_solver.h:1335
void Clear()
Clears all variables and coefficients. Does not clear the bounds.
bool is_lazy() const
Advanced usage: returns true if the constraint is "lazy" (see below).
Definition: linear_solver.h:1278
friend class XpressInterface
Definition: linear_solver.h:1331
friend class GurobiInterface
Definition: linear_solver.h:1329
void set_is_lazy(bool laziness)
Advanced usage: sets the constraint "laziness".
Definition: linear_solver.h:1293
friend class SatInterface
Definition: linear_solver.h:1334
int index() const
Returns the index of the constraint in the MPSolver::constraints_.
Definition: linear_solver.h:1299
void set_dual_value(double dual_value)
Definition: linear_solver.h:1354
friend class GLPKInterface
Definition: linear_solver.h:1326
friend class CplexInterface
Definition: linear_solver.h:1330
friend class HighsInterface
Definition: linear_solver.h:1336
MPSolver::BasisStatus basis_status() const
Advanced usage: returns the basis status of the constraint.
friend class KnapsackInterface
Definition: linear_solver.h:1337
double dual_value() const
Advanced usage: returns the dual value of the constraint in the current solution (only available for ...
friend class CBCInterface
Definition: linear_solver.h:1324
A class to express a linear objective.
Definition: linear_solver.h:975
friend class SCIPInterface
Definition: linear_solver.h:1073
void SetCoefficient(const MPVariable *const var, double coeff)
Sets the coefficient of the variable in the objective.
double GetCoefficient(const MPVariable *const var) const
Gets the coefficient of a given variable in the objective.
void SetOffset(double value)
Sets the constant term in the objective.
bool maximization() const
Is the optimization direction set to maximize?
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...
friend class SLMInterface
Definition: linear_solver.h:1074
friend class CLPInterface
Definition: linear_solver.h:1071
void AddLinearExpr(const LinearExpr &linear_expr)
Adds linear_expr to the current objective, does not change the direction.
const absl::flat_hash_map< const MPVariable *, double > & terms() const
Returns a map from variables to their coefficients in the objective.
Definition: linear_solver.h:1003
void MinimizeLinearExpr(const LinearExpr &linear_expr)
Resets the current objective to minimize linear_expr.
Definition: linear_solver.h:1024
friend class GLOPInterface
Definition: linear_solver.h:1078
friend class BopInterface
Definition: linear_solver.h:1079
double Value() const
Returns the objective value of the best solution found so far.
friend class PdlpInterface
Definition: linear_solver.h:1081
double BestBound() const
Returns the best objective bound.
bool minimization() const
Is the optimization direction set to minimize?
void Clear()
Clears the offset, all variables and coefficients, and the optimization direction.
friend class XpressInterface
Definition: linear_solver.h:1077
void MaximizeLinearExpr(const LinearExpr &linear_expr)
Resets the current objective to maximize linear_expr.
Definition: linear_solver.h:1020
friend class GurobiInterface
Definition: linear_solver.h:1075
friend class SatInterface
Definition: linear_solver.h:1080
void SetOptimizationDirection(bool maximize)
Sets the optimization direction (maximize: true or minimize: false).
friend class GLPKInterface
Definition: linear_solver.h:1072
friend class CplexInterface
Definition: linear_solver.h:1076
friend class HighsInterface
Definition: linear_solver.h:1082
friend class KnapsackInterface
Definition: linear_solver.h:1083
friend class CBCInterface
Definition: linear_solver.h:1070
This mathematical programming (MP) solver class is the main class though which users build and solve ...
Definition: linear_solver.h:184
void FillSolutionResponseProto(MPSolutionResponse *response) const
Encodes the current solution in a solution response protocol buffer.
MPConstraint * MakeRowConstraint(const LinearRange &range)
Creates a constraint owned by MPSolver enforcing: range.lower_bound() <= range.linear_expr() <= range...
MPConstraint * MakeRowConstraint(double lb, double ub)
Creates a linear constraint with given bounds.
void * underlying_solver()
Advanced usage: returns the underlying solver.
virtual ~MPSolver()
ABSL_MUST_USE_RESULT bool NextSolution()
Some solvers (MIP only, not LP) can produce multiple solutions to the problem.
const std::string & Name() const
Returns the name of the model set at construction.
Definition: linear_solver.h:293
MPConstraint * constraint(int index) const
Returns the constraint at the given index.
Definition: linear_solver.h:390
void MakeBoolVarArray(int nb, const std::string &name, std::vector< MPVariable * > *vars)
Creates an array of boolean variables.
MPVariable * MakeBoolVar(const std::string &name)
Creates a boolean variable.
MPObjective * MutableObjective()
Returns the mutable objective object.
Definition: linear_solver.h:441
friend class SCIPInterface
Definition: linear_solver.h:851
bool IsMIP() const
bool VerifySolution(double tolerance, bool log_errors) const
Advanced usage: Verifies the correctness of the solution.
MPConstraint * MakeRowConstraint(const std::string &name)
Creates a named constraint with -infinity and +infinity bounds.
MPVariable * MakeIntVar(double lb, double ub, const std::string &name)
Creates an integer variable.
const std::vector< MPVariable * > & variables() const
Returns the array of variables handled by the MPSolver.
Definition: linear_solver.h:316
static MPSolver * CreateSolver(const std::string &solver_id)
Recommended factory method to create a MPSolver instance, especially in non C++ languages.
absl::Duration DurationSinceConstruction() const
Definition: linear_solver.h:738
void Reset()
Advanced usage: resets extracted model to solve from scratch.
static bool ParseSolverType(absl::string_view solver_id, OptimizationProblemType *type)
Parses the name of the solver.
static OptimizationProblemType ParseSolverTypeOrDie(const std::string &solver_id)
Parses the name of the solver and returns the correct optimization type or dies.
int64_t iterations() const
Returns the number of simplex iterations.
void SetStartingLpBasis(const std::vector< MPSolver::BasisStatus > &variable_statuses, const std::vector< MPSolver::BasisStatus > &constraint_statuses)
Advanced usage: Incrementality.
void SetHint(std::vector< std::pair< const MPVariable *, double > > hint)
Sets a hint for solution.
double ComputeExactConditionNumber() const
Advanced usage: computes the exact condition number of the current scaled basis: L1norm(B) * L1norm(i...
@ MODEL_INVALID
the model is trivially invalid (NaN coefficients, etc).
Definition: linear_solver.h:461
MPConstraint * MakeRowConstraint(double lb, double ub, const std::string &name)
Creates a named constraint with given bounds.
const std::vector< MPConstraint * > & constraints() const
Returns the array of constraints handled by the MPSolver.
Definition: linear_solver.h:387
void MakeNumVarArray(int nb, double lb, double ub, const std::string &name, std::vector< MPVariable * > *vars)
Creates an array of continuous variables.
void MakeVarArray(int nb, double lb, double ub, bool integer, const std::string &name_prefix, std::vector< MPVariable * > *vars)
Creates an array of variables.
friend class GLOPInterface
Definition: linear_solver.h:857
static int64_t global_num_constraints()
static void SolveWithProto(const MPModelRequest &model_request, MPSolutionResponse *response, std::atomic< bool > *interrupt=nullptr)
Solves the model encoded by a MPModelRequest protocol buffer and fills the solution encoded as a MPSo...
MPVariable * MakeVar(double lb, double ub, bool integer, const std::string &name)
Creates a variable with the given bounds, integrality requirement and name.
void set_time_limit(int64_t time_limit_milliseconds)
Definition: linear_solver.h:834
OptimizationProblemType
The type of problems (LP or MIP) that will be solved and the underlying solver (GLOP,...
Definition: linear_solver.h:192
@ CLP_LINEAR_PROGRAMMING
Definition: linear_solver.h:195
@ GLOP_LINEAR_PROGRAMMING
Definition: linear_solver.h:197
@ CPLEX_MIXED_INTEGER_PROGRAMMING
Definition: linear_solver.h:215
@ KNAPSACK_MIXED_INTEGER_PROGRAMMING
Definition: linear_solver.h:232
@ XPRESS_LINEAR_PROGRAMMING
Definition: linear_solver.h:216
@ GLPK_LINEAR_PROGRAMMING
Definition: linear_solver.h:196
@ CPLEX_LINEAR_PROGRAMMING
Definition: linear_solver.h:214
@ GUROBI_LINEAR_PROGRAMMING
Definition: linear_solver.h:212
@ XPRESS_MIXED_INTEGER_PROGRAMMING
Definition: linear_solver.h:217
@ GUROBI_MIXED_INTEGER_PROGRAMMING
Definition: linear_solver.h:213
@ BOP_INTEGER_PROGRAMMING
Definition: linear_solver.h:222
@ SCIP_MIXED_INTEGER_PROGRAMMING
Definition: linear_solver.h:207
@ HIGHS_LINEAR_PROGRAMMING
Definition: linear_solver.h:202
@ PDLP_LINEAR_PROGRAMMING
Definition: linear_solver.h:201
@ SAT_INTEGER_PROGRAMMING
Definition: linear_solver.h:229
@ GLPK_MIXED_INTEGER_PROGRAMMING
Definition: linear_solver.h:208
@ CBC_MIXED_INTEGER_PROGRAMMING
Definition: linear_solver.h:209
@ HIGHS_MIXED_INTEGER_PROGRAMMING
Definition: linear_solver.h:218
bool SetSolverSpecificParametersAsString(const std::string ¶meters)
Advanced usage: pass solver specific parameters in text format.
absl::Status LoadSolutionFromProto(const MPSolutionResponse &response, double tolerance=std::numeric_limits< double >::infinity())
Load a solution encoded in a protocol buffer onto this solver for easy access via the MPSolver interf...
absl::Status SetNumThreads(int num_threads)
Sets the number of threads to use by the underlying solver.
std::string SolverVersion() const
Returns a string describing the underlying solver and its version.
bool SupportsCallbacks() const
void ExportModelToProto(MPModelProto *output_model) const
Exports model to protocol buffer.
int GetNumThreads() const
Returns the number of threads to be used during solve.
Definition: linear_solver.h:652
void MakeIntVarArray(int nb, double lb, double ub, const std::string &name, std::vector< MPVariable * > *vars)
Creates an array of integer variables.
std::string GetSolverSpecificParametersAsString() const
Definition: linear_solver.h:661
MPVariable * LookupVariableOrNull(const std::string &var_name) const
Looks up a variable by name, and returns nullptr if it does not exist.
friend class PdlpInterface
Definition: linear_solver.h:860
absl::Status ClampSolutionWithinBounds()
Resets values of out of bound variables to the corresponding bound and returns an error if any of the...
ResultStatus Solve()
Solves the problem using the default parameter values.
static int64_t global_num_variables()
bool OwnsVariable(const MPVariable *var) const
int64_t nodes() const
Returns the number of branch-and-bound nodes evaluated during the solve.
void Clear()
Clears the objective (including the optimization direction), all variables and constraints.
bool ExportModelAsLpFormat(bool obfuscate, std::string *model_str) const
Shortcuts to the homonymous MPModelProtoExporter methods, via exporting to a MPModelProto with Export...
ResultStatus Solve(const MPSolverParameters ¶m)
Solves the problem using the specified parameter values.
void Write(const std::string &file_name)
Writes the model using the solver internal write function.
void SetCallback(MPCallback *mp_callback)
MPSolverResponseStatus LoadModelFromProto(const MPModelProto &input_model, std::string *error_message)
Loads model from protocol buffer.
std::vector< double > ComputeConstraintActivities() const
Advanced usage: compute the "activities" of all constraints, which are the sums of their linear terms...
bool OutputIsEnabled() const
Controls (or queries) the amount of output produced by the underlying solver.
bool ExportModelAsMpsFormat(bool fixed_format, bool obfuscate, std::string *model_str) const
MPConstraint * MakeRowConstraint()
Creates a constraint with -infinity and +infinity bounds.
MPConstraint * LookupConstraintOrNull(const std::string &constraint_name) const
Looks up a constraint by name, and returns nullptr if it does not exist.
friend class XpressInterface
Definition: linear_solver.h:854
friend class GurobiInterface
Definition: linear_solver.h:852
bool InterruptSolve()
Interrupts the Solve() execution to terminate processing if possible.
MPVariable * variable(int index) const
Returns the variable at position index.
Definition: linear_solver.h:321
MPSolver(const std::string &name, OptimizationProblemType problem_type)
Create a solver with the given name and underlying solver backend.
double time_limit_in_secs() const
Definition: linear_solver.h:839
friend class GLPKInterface
Definition: linear_solver.h:848
static bool SolverTypeSupportsInterruption(const MPModelRequest::SolverType solver)
Definition: linear_solver.h:570
MPVariable * MakeNumVar(double lb, double ub, const std::string &name)
Creates a continuous variable.
MPSolverResponseStatus LoadModelFromProtoWithUniqueNamesOrDie(const MPModelProto &input_model, std::string *error_message)
Loads model from protocol buffer.
friend class CplexInterface
Definition: linear_solver.h:853
friend class HighsInterface
Definition: linear_solver.h:861
friend class KnapsackInterface
Definition: linear_solver.h:862
virtual OptimizationProblemType ProblemType() const
Returns the optimization problem type set at construction.
Definition: linear_solver.h:298
absl::Duration TimeLimit() const
Definition: linear_solver.h:732
static bool SupportsProblemType(OptimizationProblemType problem_type)
Whether the given problem type is supported (this will depend on the targets that you linked).
MPConstraint * MakeRowConstraint(const LinearRange &range, const std::string &name)
As above, but also names the constraint.
BasisStatus
Advanced usage: possible basis status values for a variable and the slack variable of a linear constr...
Definition: linear_solver.h:686
void SetTimeLimit(absl::Duration time_limit)
Definition: linear_solver.h:733
double best_objective_bound() const
virtual void SetLpAlgorithm(int value)=0
virtual absl::Status SetNumThreads(int num_threads)
virtual void SetUnsupportedIntegerParam(MPSolverParameters::IntegerParam param)
virtual void ExtractObjective()=0
void set_quiet(bool quiet_value)
Definition: linear_solver.h:1732
virtual bool SupportsCallbacks() const
Definition: linear_solver.h:1767
virtual void * underlying_solver()=0
void SetUnsupportedDoubleParam(MPSolverParameters::DoubleParam param)
virtual void ExtractNewVariables()=0
virtual void Write(const std::string &filename)
void set_constraint_as_extracted(int ct_index, bool extracted)
Definition: linear_solver.h:1725
MPSolver::ResultStatus result_status_
Definition: linear_solver.h:1781
virtual bool AddIndicatorConstraint(MPConstraint *const ct)
Definition: linear_solver.h:1643
static const int kDummyVariableIndex
Definition: linear_solver.h:1801
virtual void AddVariable(MPVariable *const var)=0
void InvalidateSolutionSynchronization()
MPSolver *const solver_
Definition: linear_solver.h:1776
void SetMIPParameters(const MPSolverParameters ¶m)
int last_constraint_index_
Definition: linear_solver.h:1786
virtual void Reset()=0
virtual bool IsContinuous() const =0
virtual int64_t iterations() const =0
virtual int64_t nodes() const =0
MPSolverInterface(MPSolver *const solver)
bool constraint_is_extracted(int ct_index) const
Definition: linear_solver.h:1722
virtual void SetVariableBounds(int index, double lb, double ub)=0
virtual void SetPrimalTolerance(double value)=0
static constexpr int64_t kUnknownNumberOfNodes
Definition: linear_solver.h:1592
virtual void BranchingPriorityChangedForVariable(int var_index)
Definition: linear_solver.h:1669
virtual ~MPSolverInterface()
virtual void SetParameters(const MPSolverParameters ¶m)=0
virtual void SetRelativeMipGap(double value)=0
virtual void SetIntegerParamToUnsupportedValue(MPSolverParameters::IntegerParam param, int value)
double best_objective_bound_
Definition: linear_solver.h:1794
virtual void SetOptimizationDirection(bool maximize)=0
virtual MPSolver::BasisStatus column_status(int variable_index) const =0
virtual void SetScalingMode(int value)=0
virtual void ExtractNewConstraints()=0
virtual MPSolver::BasisStatus row_status(int constraint_index) const =0
virtual std::string SolverVersion() const =0
double objective_value() const
int last_variable_index() const
Definition: linear_solver.h:1714
virtual void ClearConstraint(MPConstraint *const constraint)=0
bool CheckSolutionIsSynchronizedAndExists() const
Definition: linear_solver.h:1696
bool CheckSolutionIsSynchronized() const
virtual void SetObjectiveOffset(double value)=0
SynchronizationStatus
Definition: linear_solver.h:1574
@ SOLUTION_SYNCHRONIZED
Definition: linear_solver.h:1584
@ MODEL_SYNCHRONIZED
Definition: linear_solver.h:1581
virtual bool NextSolution()
Definition: linear_solver.h:1760
virtual void SetStartingLpBasis(const std::vector< MPSolver::BasisStatus > &variable_statuses, const std::vector< MPSolver::BasisStatus > &constraint_statuses)
Definition: linear_solver.h:1751
int last_variable_index_
Definition: linear_solver.h:1788
virtual void SetVariableInteger(int index, bool integer)=0
virtual bool SetSolverSpecificParametersAsString(const std::string ¶meters)
virtual void SetCallback(MPCallback *mp_callback)
Definition: linear_solver.h:1763
void ResetExtractionInformation()
virtual void ClearObjective()=0
bool variable_is_extracted(int var_index) const
Definition: linear_solver.h:1716
virtual bool IsMIP() const =0
virtual void SetDualTolerance(double value)=0
virtual bool CheckSolutionExists() const
virtual std::optional< MPSolutionResponse > DirectlySolveProto(const MPModelRequest &request, std::atomic< bool > *interrupt)
Definition: linear_solver.h:1610
virtual void SetPresolveMode(int value)=0
static constexpr int64_t kUnknownNumberOfIterations
Definition: linear_solver.h:1589
virtual MPSolver::ResultStatus Solve(const MPSolverParameters ¶m)=0
MPSolver::ResultStatus result_status() const
Definition: linear_solver.h:1735
virtual bool InterruptSolve()
Definition: linear_solver.h:1757
virtual void SetCoefficient(MPConstraint *const constraint, const MPVariable *const variable, double new_value, double old_value)=0
virtual void SetObjectiveCoefficient(const MPVariable *const variable, double coefficient)=0
void SetDoubleParamToUnsupportedValue(MPSolverParameters::DoubleParam param, double value)
void set_variable_as_extracted(int var_index, bool extracted)
Definition: linear_solver.h:1719
double objective_value_
Definition: linear_solver.h:1791
virtual void SetConstraintBounds(int index, double lb, double ub)=0
virtual bool IsLP() const =0
virtual double ComputeExactConditionNumber() const
void SetCommonParameters(const MPSolverParameters ¶m)
virtual void AddRowConstraint(MPConstraint *const ct)=0
void ExtractModel()
SynchronizationStatus sync_status_
Definition: linear_solver.h:1778
This class stores parameter settings for LP and MIP solvers.
Definition: linear_solver.h:1416
static const double kDefaultRelativeMipGap
Definition: linear_solver.h:1498
static const int kUnknownIntegerParamValue
Definition: linear_solver.h:1491
void ResetIntegerParam(MPSolverParameters::IntegerParam param)
Sets an integer parameter to its default value (default value defined in MPSolverParameters if it exi...
void SetDoubleParam(MPSolverParameters::DoubleParam param, double value)
Sets a double parameter to a specific value.
@ INCREMENTALITY_ON
Reuse results from previous solve as much as the underlying solver allows.
Definition: linear_solver.h:1473
void Reset()
Sets all parameters to their default value.
@ DUAL_TOLERANCE
Advanced usage: tolerance for dual feasibility of basic solutions.
Definition: linear_solver.h:1431
@ PRIMAL_TOLERANCE
Advanced usage: tolerance for primal feasibility of basic solutions.
Definition: linear_solver.h:1429
static const IncrementalityValues kDefaultIncrementality
Definition: linear_solver.h:1502
double GetDoubleParam(MPSolverParameters::DoubleParam param) const
Returns the value of a double parameter.
static const double kDefaultDualTolerance
Definition: linear_solver.h:1500
static const double kUnknownDoubleParamValue
Definition: linear_solver.h:1490
IntegerParam
Enumeration of parameters that take integer or categorical values.
Definition: linear_solver.h:1435
@ INCREMENTALITY
Advanced usage: incrementality from one solve to the next.
Definition: linear_solver.h:1441
PresolveValues
For each categorical parameter, enumeration of possible values.
Definition: linear_solver.h:1447
static const int kDefaultIntegerParamValue
Definition: linear_solver.h:1487
static const double kDefaultPrimalTolerance
Definition: linear_solver.h:1499
void SetIntegerParam(MPSolverParameters::IntegerParam param, int value)
Sets a integer parameter to a specific value.
static const double kDefaultDoubleParamValue
Definition: linear_solver.h:1486
int GetIntegerParam(MPSolverParameters::IntegerParam param) const
Returns the value of an integer parameter.
static const PresolveValues kDefaultPresolve
Definition: linear_solver.h:1501
MPSolverParameters()
The constructor sets all parameters to their default value.
void ResetDoubleParam(MPSolverParameters::DoubleParam param)
Sets a double parameter to its default value (default value defined in MPSolverParameters if it exist...
The class for variables of a Mathematical Programming (MP) model.
Definition: linear_solver.h:1104
void SetBounds(double lb, double ub)
Sets both the lower and upper bounds.
double unrounded_solution_value() const
Advanced usage: unrounded solution value.
friend class SCIPInterface
Definition: linear_solver.h:1183
int branching_priority() const
Advanced usage: Certain MIP solvers (e.g.
Definition: linear_solver.h:1174
void set_solution_value(double value)
Definition: linear_solver.h:1210
void SetBranchingPriority(int priority)
friend class SLMInterface
Definition: linear_solver.h:1184
friend class CLPInterface
Definition: linear_solver.h:1181
friend class GLOPInterface
Definition: linear_solver.h:1188
friend class BopInterface
Definition: linear_solver.h:1190
double reduced_cost() const
Advanced usage: returns the reduced cost of the variable in the current solution (only available for ...
friend class MPVariableSolutionValueTest
Definition: linear_solver.h:1189
void SetInteger(bool integer)
Sets the integrality requirement of the variable.
friend class PdlpInterface
Definition: linear_solver.h:1192
MPVariable(int index, double lb, double ub, bool integer, const std::string &name, MPSolverInterface *const interface_in)
Definition: linear_solver.h:1199
void set_reduced_cost(double reduced_cost)
Definition: linear_solver.h:1211
bool integer() const
Returns the integrality requirement of the variable.
Definition: linear_solver.h:1113
friend class XpressInterface
Definition: linear_solver.h:1187
friend class GurobiInterface
Definition: linear_solver.h:1185
friend class SatInterface
Definition: linear_solver.h:1191
int index() const
Returns the index of the variable in the MPSolver::variables_.
Definition: linear_solver.h:1125
double solution_value() const
Returns the value of the variable in the current solution.
friend class GLPKInterface
Definition: linear_solver.h:1182
friend class CplexInterface
Definition: linear_solver.h:1186
friend class HighsInterface
Definition: linear_solver.h:1193
MPSolver::BasisStatus basis_status() const
Advanced usage: returns the basis status of the variable in the current solution (only available for ...
friend class KnapsackInterface
Definition: linear_solver.h:1194
friend class CBCInterface
Definition: linear_solver.h:1180
This file allows you to write natural code (like a mathematical equation) to model optimization probl...
ABSL_DECLARE_FLAG(bool, linear_solver_enable_verbose_output)
Definition: linear_expr.h:84
constexpr double kDefaultPrimalTolerance
Definition: linear_solver.h:169
bool MPSolverResponseStatusIsRpcError(MPSolverResponseStatus status)
bool AbslParseFlag(absl::string_view text, MPSolver::OptimizationProblemType *solver_type, std::string *error)
bool SolverTypeIsMip(MPModelRequest::SolverType solver_type)
std::ostream & operator<<(std::ostream &stream, const LinearExpr &linear_expr)
std::string AbslUnparseFlag(MPSolver::OptimizationProblemType solver_type)
Definition: linear_solver.h:969
const absl::string_view ToString(MPSolver::OptimizationProblemType optimization_problem_type)