![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
This class stores parameter settings for LP and MIP solvers. Some parameters are marked as advanced: do not change their values unless you know what you are doing!
For developers: how to add a new parameter:
TODO(user): store the parameter values in a protocol buffer instead. We need to figure out how to deal with the subtleties of the default values.
Definition at line 1478 of file linear_solver.h.
#include <linear_solver.h>
Public Types | |
| enum | DoubleParam { RELATIVE_MIP_GAP = 0 , PRIMAL_TOLERANCE = 1 , DUAL_TOLERANCE = 2 } |
| Enumeration of parameters that take continuous values. More... | |
| enum | IntegerParam { PRESOLVE = 1000 , LP_ALGORITHM = 1001 , INCREMENTALITY = 1002 , SCALING = 1003 } |
| Enumeration of parameters that take integer or categorical values. More... | |
| enum | PresolveValues { PRESOLVE_OFF = 0 , PRESOLVE_ON = 1 } |
| For each categorical parameter, enumeration of possible values. More... | |
| enum | LpAlgorithmValues { DUAL = 10 , PRIMAL = 11 , BARRIER = 12 } |
| LP algorithm to use. More... | |
| enum | IncrementalityValues { INCREMENTALITY_OFF = 0 , INCREMENTALITY_ON = 1 } |
| Advanced usage: Incrementality options. More... | |
| enum | ScalingValues { SCALING_OFF = 0 , SCALING_ON = 1 } |
| Advanced usage: Scaling options. More... | |
Public Member Functions | |
| MPSolverParameters () | |
| The constructor sets all parameters to their default value. | |
| MPSolverParameters (const MPSolverParameters &)=delete | |
| MPSolverParameters & | operator= (const MPSolverParameters &)=delete |
| void | SetDoubleParam (MPSolverParameters::DoubleParam param, double value) |
| Sets a double parameter to a specific value. | |
| void | SetIntegerParam (MPSolverParameters::IntegerParam param, int value) |
| Sets a integer parameter to a specific value. | |
| void | ResetDoubleParam (MPSolverParameters::DoubleParam param) |
| void | ResetIntegerParam (MPSolverParameters::IntegerParam param) |
| void | Reset () |
| Sets all parameters to their default value. | |
| double | GetDoubleParam (MPSolverParameters::DoubleParam param) const |
| Returns the value of a double parameter. | |
| int | GetIntegerParam (MPSolverParameters::IntegerParam param) const |
| Returns the value of an integer parameter. | |
Static Public Attributes | |
| static const double | kDefaultDoubleParamValue = -1.0 |
| static const int | kDefaultIntegerParamValue = -1 |
| static const double | kUnknownDoubleParamValue = -2.0 |
| static const int | kUnknownIntegerParamValue = -2 |
| static const double | kDefaultRelativeMipGap = 1e-4 |
| static const double | kDefaultPrimalTolerance |
| static const double | kDefaultDualTolerance = 1e-7 |
| static const PresolveValues | kDefaultPresolve |
| static const IncrementalityValues | kDefaultIncrementality |
Enumeration of parameters that take continuous values.
Definition at line 1485 of file linear_solver.h.
Advanced usage: Incrementality options.
| Enumerator | |
|---|---|
| INCREMENTALITY_OFF | Start solve from scratch. |
| INCREMENTALITY_ON | Reuse results from previous solve as much as the underlying solver allows. |
Definition at line 1531 of file linear_solver.h.
Enumeration of parameters that take integer or categorical values.
Definition at line 1501 of file linear_solver.h.
LP algorithm to use.
| Enumerator | |
|---|---|
| DUAL | Dual simplex. |
| PRIMAL | Primal simplex. |
| BARRIER | Barrier algorithm. |
Definition at line 1521 of file linear_solver.h.
For each categorical parameter, enumeration of possible values.
| Enumerator | |
|---|---|
| PRESOLVE_OFF | Presolve is off. |
| PRESOLVE_ON | Presolve is on. |
Definition at line 1513 of file linear_solver.h.
Advanced usage: Scaling options.
| Enumerator | |
|---|---|
| SCALING_OFF | Scaling is off. |
| SCALING_ON | Scaling is on. |
Definition at line 1543 of file linear_solver.h.
| operations_research::MPSolverParameters::MPSolverParameters | ( | ) |
The constructor sets all parameters to their default value.
Definition at line 2018 of file linear_solver.cc.
|
delete |
| double operations_research::MPSolverParameters::GetDoubleParam | ( | MPSolverParameters::DoubleParam | param | ) | const |
Returns the value of a double parameter.
Definition at line 2147 of file linear_solver.cc.
| int operations_research::MPSolverParameters::GetIntegerParam | ( | MPSolverParameters::IntegerParam | param | ) | const |
Returns the value of an integer parameter.
Definition at line 2166 of file linear_solver.cc.
|
delete |
| void operations_research::MPSolverParameters::Reset | ( | ) |
Sets all parameters to their default value.
Definition at line 2137 of file linear_solver.cc.
| void operations_research::MPSolverParameters::ResetDoubleParam | ( | MPSolverParameters::DoubleParam | param | ) |
Sets a double parameter to its default value (default value defined in MPSolverParameters if it exists, otherwise the default value defined in the underlying solver).
Definition at line 2091 of file linear_solver.cc.
| void operations_research::MPSolverParameters::ResetIntegerParam | ( | MPSolverParameters::IntegerParam | param | ) |
Sets an integer parameter to its default value (default value defined in MPSolverParameters if it exists, otherwise the default value defined in the underlying solver).
Definition at line 2112 of file linear_solver.cc.
| void operations_research::MPSolverParameters::SetDoubleParam | ( | MPSolverParameters::DoubleParam | param, |
| double | value ) |
Sets a double parameter to a specific value.
Definition at line 2028 of file linear_solver.cc.
| void operations_research::MPSolverParameters::SetIntegerParam | ( | MPSolverParameters::IntegerParam | param, |
| int | value ) |
Sets a integer parameter to a specific value.
Definition at line 2049 of file linear_solver.cc.
|
static |
Definition at line 1552 of file linear_solver.h.
|
static |
Definition at line 1566 of file linear_solver.h.
|
static |
Definition at line 1568 of file linear_solver.h.
|
static |
Definition at line 1553 of file linear_solver.h.
|
static |
Definition at line 1567 of file linear_solver.h.
|
static |
Definition at line 1565 of file linear_solver.h.
|
static |
Definition at line 1564 of file linear_solver.h.
|
static |
Definition at line 1556 of file linear_solver.h.
|
static |
Definition at line 1557 of file linear_solver.h.