Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.linearsolver.MPSolverParameters Class Reference

Classes

enum  DoubleParam
 
enum  IncrementalityValues
 
enum  IntegerParam
 
enum  LpAlgorithmValues
 
enum  PresolveValues
 
enum  ScalingValues
 

Public Member Functions

synchronized void delete ()
 
 MPSolverParameters ()
 
void setDoubleParam (MPSolverParameters.DoubleParam param, double value)
 
void setIntegerParam (MPSolverParameters.IntegerParam param, int value)
 
double getDoubleParam (MPSolverParameters.DoubleParam param)
 
int getIntegerParam (MPSolverParameters.IntegerParam param)
 

Static Public Member Functions

static double getKDefaultRelativeMipGap ()
 
static double getKDefaultPrimalTolerance ()
 
static double getKDefaultDualTolerance ()
 
static MPSolverParameters.PresolveValues getKDefaultPresolve ()
 
static MPSolverParameters.IncrementalityValues getKDefaultIncrementality ()
 

Protected Member Functions

 MPSolverParameters (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 

Static Protected Member Functions

static long getCPtr (MPSolverParameters obj)
 
static long swigRelease (MPSolverParameters obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

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:

  • Add the new Foo parameter in the DoubleParam or IntegerParam enum.
  • If it is a categorical param, add a FooValues enum.
  • Decide if the wrapper should define a default value for it: yes
    if it controls the properties of the solution (example:
    tolerances) or if it consistently improves performance, no
    otherwise. If yes, define kDefaultFoo.
  • Add a foo_value_ member and, if no default value is defined, a
    foo_is_default_ member.
  • Add code to handle Foo in Set...Param, Reset...Param,
    Get...Param, Reset and the constructor.
  • In class MPSolverInterface, add a virtual method SetFoo, add it
    to SetCommonParameters or SetMIPParameters, and implement it for
    each solver. Sometimes, parameters need to be implemented
    differently, see for example the INCREMENTALITY implementation.
  • Add a test in linear_solver_test.cc.

    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 39 of file MPSolverParameters.java.

Constructor & Destructor Documentation

◆ MPSolverParameters() [1/2]

com.google.ortools.linearsolver.MPSolverParameters.MPSolverParameters ( long cPtr,
boolean cMemoryOwn )
protected

Definition at line 43 of file MPSolverParameters.java.

◆ MPSolverParameters() [2/2]

com.google.ortools.linearsolver.MPSolverParameters.MPSolverParameters ( )

The constructor sets all parameters to their default value.

Definition at line 102 of file MPSolverParameters.java.

Member Function Documentation

◆ delete()

synchronized void com.google.ortools.linearsolver.MPSolverParameters.delete ( )

Definition at line 69 of file MPSolverParameters.java.

◆ finalize()

void com.google.ortools.linearsolver.MPSolverParameters.finalize ( )
protected

Definition at line 65 of file MPSolverParameters.java.

◆ getCPtr()

static long com.google.ortools.linearsolver.MPSolverParameters.getCPtr ( MPSolverParameters obj)
staticprotected

Definition at line 48 of file MPSolverParameters.java.

◆ getDoubleParam()

double com.google.ortools.linearsolver.MPSolverParameters.getDoubleParam ( MPSolverParameters.DoubleParam param)

Returns the value of a double parameter.

Definition at line 123 of file MPSolverParameters.java.

◆ getIntegerParam()

int com.google.ortools.linearsolver.MPSolverParameters.getIntegerParam ( MPSolverParameters.IntegerParam param)

Returns the value of an integer parameter.

Definition at line 130 of file MPSolverParameters.java.

◆ getKDefaultDualTolerance()

static double com.google.ortools.linearsolver.MPSolverParameters.getKDefaultDualTolerance ( )
static

Definition at line 87 of file MPSolverParameters.java.

◆ getKDefaultIncrementality()

static MPSolverParameters.IncrementalityValues com.google.ortools.linearsolver.MPSolverParameters.getKDefaultIncrementality ( )
static

Definition at line 95 of file MPSolverParameters.java.

◆ getKDefaultPresolve()

static MPSolverParameters.PresolveValues com.google.ortools.linearsolver.MPSolverParameters.getKDefaultPresolve ( )
static

Definition at line 91 of file MPSolverParameters.java.

◆ getKDefaultPrimalTolerance()

static double com.google.ortools.linearsolver.MPSolverParameters.getKDefaultPrimalTolerance ( )
static

Definition at line 83 of file MPSolverParameters.java.

◆ getKDefaultRelativeMipGap()

static double com.google.ortools.linearsolver.MPSolverParameters.getKDefaultRelativeMipGap ( )
static

Definition at line 79 of file MPSolverParameters.java.

◆ setDoubleParam()

void com.google.ortools.linearsolver.MPSolverParameters.setDoubleParam ( MPSolverParameters.DoubleParam param,
double value )

Sets a double parameter to a specific value.

Definition at line 109 of file MPSolverParameters.java.

◆ setIntegerParam()

void com.google.ortools.linearsolver.MPSolverParameters.setIntegerParam ( MPSolverParameters.IntegerParam param,
int value )

Sets a integer parameter to a specific value.

Definition at line 116 of file MPSolverParameters.java.

◆ swigRelease()

static long com.google.ortools.linearsolver.MPSolverParameters.swigRelease ( MPSolverParameters obj)
staticprotected

Definition at line 52 of file MPSolverParameters.java.

Member Data Documentation

◆ swigCMemOwn

transient boolean com.google.ortools.linearsolver.MPSolverParameters.swigCMemOwn
protected

Definition at line 41 of file MPSolverParameters.java.


The documentation for this class was generated from the following file: