Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <linear_solver.h>
Public Types | |
enum | SynchronizationStatus { MUST_RELOAD , MODEL_SYNCHRONIZED , SOLUTION_SYNCHRONIZED } |
Public Member Functions | |
MPSolverInterface (MPSolver *solver) | |
virtual | ~MPSolverInterface () |
virtual MPSolver::ResultStatus | Solve (const MPSolverParameters ¶m)=0 |
virtual bool | SupportsDirectlySolveProto (std::atomic< bool > *) const |
virtual MPSolutionResponse | DirectlySolveProto (LazyMutableCopy< MPModelRequest >, std::atomic< bool > *) |
virtual void | Write (const std::string &filename) |
virtual void | Reset ()=0 |
virtual void | SetOptimizationDirection (bool maximize)=0 |
Sets the optimization direction (min/max). | |
virtual void | SetVariableBounds (int index, double lb, double ub)=0 |
Modifies bounds of an extracted variable. | |
virtual void | SetVariableInteger (int index, bool integer)=0 |
Modifies integrality of an extracted variable. | |
virtual void | SetConstraintBounds (int index, double lb, double ub)=0 |
Modify bounds of an extracted variable. | |
virtual void | AddRowConstraint (MPConstraint *ct)=0 |
Adds a linear constraint. | |
virtual bool | AddIndicatorConstraint (MPConstraint *const) |
virtual void | AddVariable (MPVariable *var)=0 |
Add a variable. | |
virtual void | SetCoefficient (MPConstraint *constraint, const MPVariable *variable, double new_value, double old_value)=0 |
Changes a coefficient in a constraint. | |
virtual void | ClearConstraint (MPConstraint *constraint)=0 |
Clears a constraint from all its terms. | |
virtual void | SetObjectiveCoefficient (const MPVariable *variable, double coefficient)=0 |
Changes a coefficient in the linear objective. | |
virtual void | SetObjectiveOffset (double value)=0 |
Changes the constant term in the linear objective. | |
virtual void | ClearObjective ()=0 |
Clears the objective from all its terms. | |
virtual void | BranchingPriorityChangedForVariable (int) |
virtual int64_t | iterations () const =0 |
virtual int64_t | nodes () const =0 |
double | best_objective_bound () const |
double | objective_value () const |
Returns the objective value of the best solution found so far. | |
virtual MPSolver::BasisStatus | row_status (int constraint_index) const =0 |
Returns the basis status of a row. | |
virtual MPSolver::BasisStatus | column_status (int variable_index) const =0 |
Returns the basis status of a constraint. | |
bool | CheckSolutionIsSynchronized () const |
virtual bool | CheckSolutionExists () const |
bool | CheckSolutionIsSynchronizedAndExists () const |
Handy shortcut to do both checks above (it is often used). | |
virtual bool | IsContinuous () const =0 |
virtual bool | IsLP () const =0 |
Returns true if the problem is continuous and linear. | |
virtual bool | IsMIP () const =0 |
Returns true if the problem is discrete and linear. | |
int | last_variable_index () const |
Returns the index of the last variable extracted. | |
bool | variable_is_extracted (int var_index) const |
void | set_variable_as_extracted (int var_index, bool extracted) |
bool | constraint_is_extracted (int ct_index) const |
void | set_constraint_as_extracted (int ct_index, bool extracted) |
bool | quiet () const |
Returns the boolean indicating the verbosity of the solver output. | |
void | set_quiet (bool quiet_value) |
Sets the boolean indicating the verbosity of the solver output. | |
MPSolver::ResultStatus | result_status () const |
Returns the result status of the last solve. | |
virtual std::string | SolverVersion () const =0 |
Returns a string describing the underlying solver and its version. | |
virtual void * | underlying_solver ()=0 |
Returns the underlying solver. | |
virtual double | ComputeExactConditionNumber () const |
virtual void | SetStartingLpBasis (const std::vector< MPSolver::BasisStatus > &, const std::vector< MPSolver::BasisStatus > &) |
See MPSolver::SetStartingLpBasis(). | |
virtual double | infinity () |
virtual bool | InterruptSolve () |
virtual bool | NextSolution () |
See MPSolver::NextSolution() for contract. | |
virtual void | SetCallback (MPCallback *) |
See MPSolver::SetCallback() for details. | |
virtual bool | SupportsCallbacks () const |
Static Public Attributes | |
static constexpr int64_t | kUnknownNumberOfIterations = -1 |
static constexpr int64_t | kUnknownNumberOfNodes = -1 |
Protected Member Functions | |
void | ExtractModel () |
Extracts model stored in MPSolver. | |
virtual void | ExtractNewVariables ()=0 |
Extracts the variables that have not been extracted yet. | |
virtual void | ExtractNewConstraints ()=0 |
Extracts the constraints that have not been extracted yet. | |
virtual void | ExtractObjective ()=0 |
Extracts the objective. | |
void | ResetExtractionInformation () |
Resets the extraction information. | |
void | InvalidateSolutionSynchronization () |
void | SetCommonParameters (const MPSolverParameters ¶m) |
Sets parameters common to LP and MIP in the underlying solver. | |
void | SetMIPParameters (const MPSolverParameters ¶m) |
Sets MIP specific parameters in the underlying solver. | |
virtual void | SetParameters (const MPSolverParameters ¶m)=0 |
Sets all parameters in the underlying solver. | |
void | SetUnsupportedDoubleParam (MPSolverParameters::DoubleParam param) |
Sets an unsupported double parameter. | |
virtual void | SetUnsupportedIntegerParam (MPSolverParameters::IntegerParam param) |
Sets an unsupported integer parameter. | |
void | SetDoubleParamToUnsupportedValue (MPSolverParameters::DoubleParam param, double value) |
Sets a supported double parameter to an unsupported value. | |
virtual void | SetIntegerParamToUnsupportedValue (MPSolverParameters::IntegerParam param, int value) |
Sets a supported integer parameter to an unsupported value. | |
virtual void | SetRelativeMipGap (double value)=0 |
Sets each parameter in the underlying solver. | |
virtual void | SetPrimalTolerance (double value)=0 |
virtual void | SetDualTolerance (double value)=0 |
virtual void | SetPresolveMode (int value)=0 |
virtual absl::Status | SetNumThreads (int num_threads) |
Sets the number of threads to be used by the solver. | |
virtual bool | SetSolverSpecificParametersAsString (const std::string ¶meters) |
virtual void | SetScalingMode (int value)=0 |
Sets the scaling mode. | |
virtual void | SetLpAlgorithm (int value)=0 |
Protected Attributes | |
MPSolver *const | solver_ |
SynchronizationStatus | sync_status_ |
Indicates whether the model and the solution are synchronized. | |
MPSolver::ResultStatus | result_status_ |
bool | maximize_ |
Optimization direction. | |
int | last_constraint_index_ |
Index in MPSolver::variables_ of last constraint extracted. | |
int | last_variable_index_ |
Index in MPSolver::constraints_ of last variable extracted. | |
double | objective_value_ |
The value of the objective function. | |
double | best_objective_bound_ |
The value of the best objective bound. Used only for MIP solvers. | |
bool | quiet_ |
Boolean indicator for the verbosity of the solver output. | |
Static Protected Attributes | |
static const int | kDummyVariableIndex = 0 |
-------— MPSolverInterface -------— | |
Friends | |
class | MPSolver |
class | MPConstraint |
To access the maximize_ bool and the MPSolver. | |
class | MPObjective |
This class wraps the actual mathematical programming solvers. Each solver (GLOP, CLP, CBC, GLPK, SCIP) has its own interface class that derives from this abstract class. This class is never directly accessed by the user.
Definition at line 1634 of file linear_solver.h.
Enumerator | |
---|---|
MUST_RELOAD | The underlying solver (CLP, GLPK, ...) and MPSolver are not in sync for the model nor for the solution. |
MODEL_SYNCHRONIZED | The underlying solver and MPSolver are in sync for the model but not for the solution: the model has changed since the solution was computed last. |
SOLUTION_SYNCHRONIZED | The underlying solver and MPSolver are in sync for the model and the solution. |
Definition at line 1636 of file linear_solver.h.
|
explicit |
Constructor. The user will access the MPSolverInterface through the MPSolver passed as argument.
Definition at line 1958 of file linear_solver.cc.
|
virtual |
Definition at line 1969 of file linear_solver.cc.
|
inlinevirtual |
Adds an indicator constraint. Returns true if the feature is supported by the underlying solver.
Reimplemented in operations_research::GurobiInterface, operations_research::SatInterface, and operations_research::SCIPInterface.
Definition at line 1710 of file linear_solver.h.
|
pure virtual |
Adds a linear constraint.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
Add a variable.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
double operations_research::MPSolverInterface::best_objective_bound | ( | ) | const |
Returns the best objective bound. The problem must be discrete, otherwise it crashes, or returns trivial bound (+/- inf) in NDEBUG mode.
Special case for empty model.
Definition at line 2038 of file linear_solver.cc.
|
inlinevirtual |
Reimplemented in operations_research::GurobiInterface, and operations_research::SCIPInterface.
Definition at line 1736 of file linear_solver.h.
|
virtual |
Checks whether a feasible solution exists. The behavior is similar to CheckSolutionIsSynchronized() above.
Default version that can be overwritten by a solver-specific version to accommodate for the quirks of each solver.
Reimplemented in operations_research::GLPKInterface.
Definition at line 2023 of file linear_solver.cc.
bool operations_research::MPSolverInterface::CheckSolutionIsSynchronized | ( | ) | const |
Checks whether the solution is synchronized with the model, i.e. whether the model has changed since the solution was computed last. If it isn't, it crashes in NDEBUG, and returns false otherwise.
Definition at line 2011 of file linear_solver.cc.
|
inline |
Handy shortcut to do both checks above (it is often used).
Definition at line 1763 of file linear_solver.h.
|
pure virtual |
Clears a constraint from all its terms.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
Clears the objective from all its terms.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
Returns the basis status of a constraint.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
virtual |
Computes exact condition number. Only available for continuous problems and only implemented in GLPK.
Override this method in interfaces that actually support it.
Reimplemented in operations_research::CplexInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, and operations_research::XpressInterface.
Definition at line 2062 of file linear_solver.cc.
|
inline |
Definition at line 1789 of file linear_solver.h.
|
inlinevirtual |
Reimplemented in operations_research::GLOPInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::PdlpInterface, operations_research::SatInterface, and operations_research::SCIPInterface.
Definition at line 1676 of file linear_solver.h.
|
protected |
Extracts model stored in MPSolver.
Everything has already been extracted.
Nothing has changed since last solve.
Definition at line 1975 of file linear_solver.cc.
|
protectedpure virtual |
Extracts the constraints that have not been extracted yet.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
protectedpure virtual |
Extracts the variables that have not been extracted yet.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
protectedpure virtual |
Extracts the objective.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
inlinevirtual |
Reimplemented in operations_research::SCIPInterface.
Definition at line 1824 of file linear_solver.h.
|
inlinevirtual |
Reimplemented in operations_research::BopInterface, operations_research::GLOPInterface, operations_research::GurobiInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
Definition at line 1826 of file linear_solver.h.
|
protected |
Change synchronization status from SOLUTION_SYNCHRONIZED to MODEL_SYNCHRONIZED. To be used for model changes.
Definition at line 2056 of file linear_solver.cc.
|
pure virtual |
--— Misc --— Queries problem type. For simplicity, the distinction between continuous and discrete is based on the declaration of the user when the solver is created (example: GLPK_LINEAR_PROGRAMMING vs. GLPK_MIXED_INTEGER_PROGRAMMING), not on the actual content of the model. Returns true if the problem is continuous.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
Returns true if the problem is continuous and linear.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
Returns true if the problem is discrete and linear.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
---— Query statistics on the solution and the solve ---— Returns the number of simplex iterations. The problem must be discrete, otherwise it crashes, or returns kUnknownNumberOfIterations in NDEBUG mode.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
inline |
Returns the index of the last variable extracted.
Definition at line 1781 of file linear_solver.h.
|
inlinevirtual |
See MPSolver::NextSolution() for contract.
Reimplemented in operations_research::GurobiInterface, and operations_research::SCIPInterface.
Definition at line 1829 of file linear_solver.h.
|
pure virtual |
Returns the number of branch-and-bound nodes. The problem must be discrete, otherwise it crashes, or returns kUnknownNumberOfNodes in NDEBUG mode.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
double operations_research::MPSolverInterface::objective_value | ( | ) | const |
Returns the objective value of the best solution found so far.
Definition at line 2033 of file linear_solver.cc.
|
inline |
Returns the boolean indicating the verbosity of the solver output.
Definition at line 1797 of file linear_solver.h.
|
pure virtual |
--— Model modifications and extraction --— Resets extracted model.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
protected |
Resets the extraction information.
Definition at line 2003 of file linear_solver.cc.
|
inline |
Returns the result status of the last solve.
Definition at line 1802 of file linear_solver.h.
|
pure virtual |
Returns the basis status of a row.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
inline |
Definition at line 1792 of file linear_solver.h.
|
inline |
Sets the boolean indicating the verbosity of the solver output.
Definition at line 1799 of file linear_solver.h.
|
inline |
Definition at line 1786 of file linear_solver.h.
|
inlinevirtual |
See MPSolver::SetCallback() for details.
Reimplemented in operations_research::GurobiInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
Definition at line 1832 of file linear_solver.h.
|
pure virtual |
Changes a coefficient in a constraint.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
protected |
Sets parameters common to LP and MIP in the underlying solver.
Definition at line 2071 of file linear_solver.cc.
|
pure virtual |
Modify bounds of an extracted variable.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
protected |
Sets a supported double parameter to an unsupported value.
Definition at line 2107 of file linear_solver.cc.
|
protectedpure virtual |
Implemented in operations_research::BopInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, and operations_research::XpressInterface.
|
protectedvirtual |
Sets a supported integer parameter to an unsupported value.
Definition at line 2112 of file linear_solver.cc.
|
protectedpure virtual |
Implemented in operations_research::BopInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, and operations_research::XpressInterface.
|
protected |
Sets MIP specific parameters in the underlying solver.
Definition at line 2092 of file linear_solver.cc.
|
protectedvirtual |
Sets the number of threads to be used by the solver.
Reimplemented in operations_research::CBCInterface, operations_research::HighsInterface, operations_research::PdlpInterface, and operations_research::SatInterface.
Definition at line 2118 of file linear_solver.cc.
|
pure virtual |
Changes a coefficient in the linear objective.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
Changes the constant term in the linear objective.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
Sets the optimization direction (min/max).
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
protectedpure virtual |
Sets all parameters in the underlying solver.
Implemented in operations_research::BopInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, and operations_research::XpressInterface.
|
protectedpure virtual |
Implemented in operations_research::BopInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, and operations_research::XpressInterface.
|
protectedpure virtual |
Implemented in operations_research::BopInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, and operations_research::XpressInterface.
|
protectedpure virtual |
Sets each parameter in the underlying solver.
Implemented in operations_research::BopInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, and operations_research::XpressInterface.
|
protectedpure virtual |
Sets the scaling mode.
Implemented in operations_research::BopInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, and operations_research::XpressInterface.
|
protectedvirtual |
Pass solver specific parameters in text format. The format is solver-specific and is the same as the corresponding solver configuration file format. Returns true if the operation was successful.
Default implementation returns true if the input is empty. It returns false and logs a WARNING if the input is not empty.
Reimplemented in operations_research::BopInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::HighsInterface, operations_research::PdlpInterface, and operations_research::SatInterface.
Definition at line 2123 of file linear_solver.cc.
|
inlinevirtual |
See MPSolver::SetStartingLpBasis().
Reimplemented in operations_research::GLOPInterface, and operations_research::XpressInterface.
Definition at line 1818 of file linear_solver.h.
|
protected |
Sets an unsupported double parameter.
Definition at line 2099 of file linear_solver.cc.
|
protectedvirtual |
Sets an unsupported integer parameter.
Definition at line 2103 of file linear_solver.cc.
|
pure virtual |
Modifies bounds of an extracted variable.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
Modifies integrality of an extracted variable.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
--— Solve --— Solves problem with specified parameter values. Returns true if the solution is optimal.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
pure virtual |
Returns a string describing the underlying solver and its version.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
inlinevirtual |
Reimplemented in operations_research::GurobiInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
Definition at line 1836 of file linear_solver.h.
|
inlinevirtual |
DirectlySolveProto() shall only be used if SupportsDirectlySolveProto() is true.
DirectlySolveProto() solves a MPModelRequest, bypassing the MPSolver data structures entirely. Like MPSolver::SolveWithProto(), optionally takes in an 'interrupt' boolean.
Reimplemented in operations_research::GLOPInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::PdlpInterface, operations_research::SatInterface, and operations_research::SCIPInterface.
Definition at line 1672 of file linear_solver.h.
|
pure virtual |
Returns the underlying solver.
Implemented in operations_research::BopInterface, operations_research::CBCInterface, operations_research::CLPInterface, operations_research::CplexInterface, operations_research::GLOPInterface, operations_research::GLPKInterface, operations_research::GurobiInterface, operations_research::HighsInterface, operations_research::KnapsackInterface, operations_research::PdlpInterface, operations_research::SatInterface, operations_research::SCIPInterface, and operations_research::XpressInterface.
|
inline |
Definition at line 1783 of file linear_solver.h.
|
virtual |
Writes the model using the solver internal write function. Currently only available for GurobiInterface and XpressInterface.
Reimplemented in operations_research::GurobiInterface, and operations_research::XpressInterface.
Definition at line 1971 of file linear_solver.cc.
|
friend |
To access the maximize_ bool and the MPSolver.
Definition at line 1841 of file linear_solver.h.
|
friend |
Definition at line 1842 of file linear_solver.h.
|
friend |
Definition at line 1838 of file linear_solver.h.
|
protected |
The value of the best objective bound. Used only for MIP solvers.
Definition at line 1863 of file linear_solver.h.
|
staticprotected |
-------— MPSolverInterface -------—
Index of dummy variable created for empty constraints or the objective offset.
Definition at line 1870 of file linear_solver.h.
|
staticconstexpr |
When the underlying solver does not provide the number of simplex iterations.
Definition at line 1651 of file linear_solver.h.
|
staticconstexpr |
When the underlying solver does not provide the number of branch-and-bound nodes.
Definition at line 1654 of file linear_solver.h.
|
protected |
Index in MPSolver::variables_ of last constraint extracted.
Definition at line 1855 of file linear_solver.h.
|
protected |
Index in MPSolver::constraints_ of last variable extracted.
Definition at line 1857 of file linear_solver.h.
|
protected |
Optimization direction.
Definition at line 1852 of file linear_solver.h.
|
protected |
The value of the objective function.
Definition at line 1860 of file linear_solver.h.
|
protected |
Boolean indicator for the verbosity of the solver output.
Definition at line 1866 of file linear_solver.h.
|
protected |
Indicates whether the solve has reached optimality, infeasibility, a limit, etc.
Definition at line 1850 of file linear_solver.h.
|
protected |
Definition at line 1845 of file linear_solver.h.
|
protected |
Indicates whether the model and the solution are synchronized.
Definition at line 1847 of file linear_solver.h.