C++ Reference: class MPSolverInterface
Note: This documentation is automatically generated.
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. @see glop_interface.cc @see cbc_interface.cc @see clp_interface.cc @see glpk_interface.cc @see scip_interface.ccMethod | |
---|---|
AddIndicatorConstraint | Return type: Arguments: Adds an indicator constraint. Returns true if the feature is supported by the underlying solver. |
AddRowConstraint | Return type: Arguments: Adds a linear constraint. |
AddVariable | Return type: Arguments: Add a variable. |
best_objective_bound | Return type: Returns the best objective bound. The problem must be discrete, otherwise it crashes, or returns trivial bound (+/- inf) in NDEBUG mode. |
BranchingPriorityChangedForVariable | Return type: Arguments: |
CheckSolutionExists | Return type: Checks whether a feasible solution exists. The behavior is similar to CheckSolutionIsSynchronized() above. |
CheckSolutionIsSynchronized | Return type: 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 othwerwise. |
CheckSolutionIsSynchronizedAndExists | Return type: Handy shortcut to do both checks above (it is often used). |
ClearConstraint | Return type: Arguments: Clears a constraint from all its terms. |
ClearObjective | Return type: Clears the objective from all its terms. |
column_status | Return type: Arguments: Returns the basis status of a constraint. |
ComputeExactConditionNumber | Return type: Computes exact condition number. Only available for continuous problems and only implemented in GLPK. |
constraint_is_extracted | Return type: Arguments: |
DirectlySolveProto | Return type: Arguments: Attempts to directly solve a MPModelRequest, bypassing the MPSolver data structures entirely. Like MPSolver::SolveWithProto(), optionally takes in an 'interrupt' boolean. Returns {} (eg. absl::nullopt) if direct-solve is not supported by the underlying solver (possibly because interrupt != nullptr), in which case the user should fall back to using MPSolver. |
InterruptSolve | Return type: |
IsContinuous | Return type: ----- 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. |
IsLP | Return type: Returns true if the problem is continuous and linear. |
IsMIP | Return type: Returns true if the problem is discrete and linear. |
iterations | Return type: ------ 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. |
last_variable_index | Return type: Returns the index of the last variable extracted. |
MPSolverInterface | Return type: Arguments: Constructor. The user will access the MPSolverInterface through the MPSolver passed as argument. |
~MPSolverInterface | Return type: |
NextSolution | Return type: See MPSolver::NextSolution() for contract. |
nodes | Return type: Returns the number of branch-and-bound nodes. The problem must be discrete, otherwise it crashes, or returns kUnknownNumberOfNodes in NDEBUG mode. |
objective_value | Return type: Returns the objective value of the best solution found so far. |
quiet | Return type: Returns the boolean indicating the verbosity of the solver output. |
Reset | Return type: ----- Model modifications and extraction ----- Resets extracted model. |
result_status | Return type: Returns the result status of the last solve. |
row_status | Return type: Arguments: Returns the basis status of a row. |
set_constraint_as_extracted | Return type: Arguments: |
set_quiet | Return type: Arguments: Sets the boolean indicating the verbosity of the solver output. |
set_variable_as_extracted | Return type: Arguments: |
SetCallback | Return type: Arguments: See MPSolver::SetCallback() for details. |
SetCoefficient | Return type: Arguments: Changes a coefficient in a constraint. |
SetConstraintBounds | Return type: Arguments: Modify bounds of an extracted variable. |
SetObjectiveCoefficient | Return type: Arguments: Changes a coefficient in the linear objective. |
SetObjectiveOffset | Return type: Arguments: Changes the constant term in the linear objective. |
SetOptimizationDirection | Return type: Arguments: Sets the optimization direction (min/max). |
SetStartingLpBasis | Return type: Arguments: See MPSolver::SetStartingLpBasis(). |
SetVariableBounds | Return type: Arguments: Modifies bounds of an extracted variable. |
SetVariableInteger | Return type: Arguments: Modifies integrality of an extracted variable. |
Solve | Return type: Arguments: ----- Solve ----- Solves problem with specified parameter values. Returns true if the solution is optimal. |
SolverVersion | Return type: Returns a string describing the underlying solver and its version. |
SupportsCallbacks | Return type: |
underlying_solver | Return type: Returns the underlying solver. |
variable_is_extracted | Return type: Arguments: |
Write | Return type: Arguments: Writes the model using the solver internal write function. Currently only available for GurobiInterface. |