Google OR-Tools: operations_research::MPSolverInterface Class Reference

Definition at line 1642 of file linear_solver.h.

#include <linear_solver.h>

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::SCIPInterface operations_research::SatInterface operations_research::XpressInterface

Public Member Functions

 MPSolverInterface (MPSolver *solver)
virtual ~MPSolverInterface ()
virtual MPSolver::ResultStatus Solve (const MPSolverParameters &param)=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
virtual void SetVariableBounds (int index, double lb, double ub)=0
virtual void SetVariableInteger (int index, bool integer)=0
virtual void SetConstraintBounds (int index, double lb, double ub)=0
virtual void AddRowConstraint (MPConstraint *ct)=0
virtual bool AddIndicatorConstraint (MPConstraint *const)
virtual void AddVariable (MPVariable *var)=0
virtual void SetCoefficient (MPConstraint *constraint, const MPVariable *variable, double new_value, double old_value)=0
virtual void ClearConstraint (MPConstraint *constraint)=0
virtual void SetObjectiveCoefficient (const MPVariable *variable, double coefficient)=0
virtual void SetObjectiveOffset (double value)=0
virtual void ClearObjective ()=0
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
virtual MPSolver::BasisStatus row_status (int constraint_index) const =0
virtual MPSolver::BasisStatus column_status (int variable_index) const =0
bool CheckSolutionIsSynchronized () const
virtual bool CheckSolutionExists () const
bool CheckSolutionIsSynchronizedAndExists () const
virtual bool IsContinuous () const =0
virtual bool IsLP () const =0
virtual bool IsMIP () const =0
int last_variable_index () const
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
void set_quiet (bool quiet_value)
MPSolver::ResultStatus result_status () const
virtual std::string SolverVersion () const =0
virtual void * underlying_solver ()=0
virtual double ComputeExactConditionNumber () const
virtual void SetStartingLpBasis (const std::vector< MPSolver::BasisStatus > &, const std::vector< MPSolver::BasisStatus > &)
virtual double infinity ()
virtual bool InterruptSolve ()
virtual bool NextSolution ()
virtual void SetCallback (MPCallback *)
virtual bool SupportsCallbacks () const

Static Public Attributes

static constexpr int64_t kUnknownNumberOfIterations = -1
static constexpr int64_t kUnknownNumberOfNodes = -1

Protected Member Functions

void ExtractModel ()
virtual void ExtractNewVariables ()=0
virtual void ExtractNewConstraints ()=0
virtual void ExtractObjective ()=0
void ResetExtractionInformation ()
void InvalidateSolutionSynchronization ()
void SetCommonParameters (const MPSolverParameters &param)
void SetMIPParameters (const MPSolverParameters &param)
virtual void SetParameters (const MPSolverParameters &param)=0
void SetUnsupportedDoubleParam (MPSolverParameters::DoubleParam param)
virtual void SetUnsupportedIntegerParam (MPSolverParameters::IntegerParam param)
void SetDoubleParamToUnsupportedValue (MPSolverParameters::DoubleParam param, double value)
virtual void SetIntegerParamToUnsupportedValue (MPSolverParameters::IntegerParam param, int value)
virtual void SetRelativeMipGap (double value)=0
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)
virtual bool SetSolverSpecificParametersAsString (const std::string &parameters)
virtual void SetScalingMode (int value)=0
virtual void SetLpAlgorithm (int value)=0

Protected Attributes

MPSolver *const solver_
SynchronizationStatus sync_status_
MPSolver::ResultStatus result_status_
bool maximize_
int last_constraint_index_
int last_variable_index_
double objective_value_
double best_objective_bound_
bool quiet_

Static Protected Attributes

static const int kDummyVariableIndex = 0

Friends

class MPSolver
class MPConstraint
class MPObjective

◆ SynchronizationStatus

Enumerator
MUST_RELOAD 
MODEL_SYNCHRONIZED 
SOLUTION_SYNCHRONIZED 

Definition at line 1644 of file linear_solver.h.

operations_research::MPSolverInterface::MPSolverInterface ( MPSolver * solver)
explicit

◆ ~MPSolverInterface()

operations_research::MPSolverInterface::~MPSolverInterface ( )
virtual

◆ AddIndicatorConstraint()

virtual bool operations_research::MPSolverInterface::AddIndicatorConstraint ( MPConstraint * const )
inlinevirtual

◆ AddRowConstraint()

virtual void operations_research::MPSolverInterface::AddRowConstraint ( MPConstraint * ct)
pure virtual

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.

◆ AddVariable()

virtual void operations_research::MPSolverInterface::AddVariable ( MPVariable * var)
pure virtual

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.

◆ best_objective_bound()

double operations_research::MPSolverInterface::best_objective_bound ( ) const

◆ BranchingPriorityChangedForVariable()

virtual void operations_research::MPSolverInterface::BranchingPriorityChangedForVariable ( int )
inlinevirtual

◆ CheckSolutionExists()

bool operations_research::MPSolverInterface::CheckSolutionExists ( ) const
virtual

◆ CheckSolutionIsSynchronized()

bool operations_research::MPSolverInterface::CheckSolutionIsSynchronized ( ) const

◆ CheckSolutionIsSynchronizedAndExists()

bool operations_research::MPSolverInterface::CheckSolutionIsSynchronizedAndExists ( ) const
inline

◆ ClearConstraint()

virtual void operations_research::MPSolverInterface::ClearConstraint ( MPConstraint * constraint)
pure virtual

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.

◆ ClearObjective()

virtual void operations_research::MPSolverInterface::ClearObjective ( )
pure virtual

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.

◆ column_status()

virtual MPSolver::BasisStatus operations_research::MPSolverInterface::column_status ( int variable_index) const
pure virtual

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.

◆ ComputeExactConditionNumber()

double operations_research::MPSolverInterface::ComputeExactConditionNumber ( ) const
virtual

◆ constraint_is_extracted()

bool operations_research::MPSolverInterface::constraint_is_extracted ( int ct_index) const
inline

◆ DirectlySolveProto()

◆ ExtractModel()

void operations_research::MPSolverInterface::ExtractModel ( )
protected

◆ ExtractNewConstraints()

virtual void operations_research::MPSolverInterface::ExtractNewConstraints ( )
protectedpure virtual

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.

◆ ExtractNewVariables()

virtual void operations_research::MPSolverInterface::ExtractNewVariables ( )
protectedpure virtual

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.

◆ ExtractObjective()

virtual void operations_research::MPSolverInterface::ExtractObjective ( )
protectedpure virtual

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.

◆ infinity()

virtual double operations_research::MPSolverInterface::infinity ( )
inlinevirtual

◆ InterruptSolve()

virtual bool operations_research::MPSolverInterface::InterruptSolve ( )
inlinevirtual

◆ InvalidateSolutionSynchronization()

void operations_research::MPSolverInterface::InvalidateSolutionSynchronization ( )
protected

◆ IsContinuous()

virtual bool operations_research::MPSolverInterface::IsContinuous ( ) const
pure virtual

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.

◆ IsLP()

virtual bool operations_research::MPSolverInterface::IsLP ( ) const
pure virtual

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.

◆ IsMIP()

virtual bool operations_research::MPSolverInterface::IsMIP ( ) const
pure virtual

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.

◆ iterations()

virtual int64_t operations_research::MPSolverInterface::iterations ( ) const
pure virtual

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.

◆ last_variable_index()

int operations_research::MPSolverInterface::last_variable_index ( ) const
inline

◆ NextSolution()

virtual bool operations_research::MPSolverInterface::NextSolution ( )
inlinevirtual

◆ nodes()

virtual int64_t operations_research::MPSolverInterface::nodes ( ) const
pure virtual

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.

◆ objective_value()

double operations_research::MPSolverInterface::objective_value ( ) const

◆ quiet()

bool operations_research::MPSolverInterface::quiet ( ) const
inline

◆ Reset()

virtual void operations_research::MPSolverInterface::Reset ( )
pure virtual

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.

◆ ResetExtractionInformation()

void operations_research::MPSolverInterface::ResetExtractionInformation ( )
protected

◆ result_status()

◆ row_status()

virtual MPSolver::BasisStatus operations_research::MPSolverInterface::row_status ( int constraint_index) const
pure virtual

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.

◆ set_constraint_as_extracted()

void operations_research::MPSolverInterface::set_constraint_as_extracted ( int ct_index,
bool extracted )
inline

◆ set_quiet()

void operations_research::MPSolverInterface::set_quiet ( bool quiet_value)
inline

◆ set_variable_as_extracted()

void operations_research::MPSolverInterface::set_variable_as_extracted ( int var_index,
bool extracted )
inline

◆ SetCallback()

virtual void operations_research::MPSolverInterface::SetCallback ( MPCallback * )
inlinevirtual

◆ SetCoefficient()

virtual void operations_research::MPSolverInterface::SetCoefficient ( MPConstraint * constraint,
const MPVariable * variable,
double new_value,
double old_value )
pure virtual

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.

◆ SetCommonParameters()

void operations_research::MPSolverInterface::SetCommonParameters ( const MPSolverParameters & param)
protected

◆ SetConstraintBounds()

virtual void operations_research::MPSolverInterface::SetConstraintBounds ( int index,
double lb,
double ub )
pure virtual

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.

◆ SetDoubleParamToUnsupportedValue()

◆ SetDualTolerance()

virtual void operations_research::MPSolverInterface::SetDualTolerance ( double value)
protectedpure virtual

◆ SetIntegerParamToUnsupportedValue()

◆ SetLpAlgorithm()

virtual void operations_research::MPSolverInterface::SetLpAlgorithm ( int value)
protectedpure virtual

◆ SetMIPParameters()

void operations_research::MPSolverInterface::SetMIPParameters ( const MPSolverParameters & param)
protected

◆ SetNumThreads()

absl::Status operations_research::MPSolverInterface::SetNumThreads ( int num_threads)
protectedvirtual

◆ SetObjectiveCoefficient()

virtual void operations_research::MPSolverInterface::SetObjectiveCoefficient ( const MPVariable * variable,
double coefficient )
pure virtual

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.

◆ SetObjectiveOffset()

virtual void operations_research::MPSolverInterface::SetObjectiveOffset ( double value)
pure virtual

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.

◆ SetOptimizationDirection()

virtual void operations_research::MPSolverInterface::SetOptimizationDirection ( bool maximize)
pure virtual

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.

◆ SetParameters()

virtual void operations_research::MPSolverInterface::SetParameters ( const MPSolverParameters & param)
protectedpure virtual

◆ SetPresolveMode()

virtual void operations_research::MPSolverInterface::SetPresolveMode ( int value)
protectedpure virtual

◆ SetPrimalTolerance()

virtual void operations_research::MPSolverInterface::SetPrimalTolerance ( double value)
protectedpure virtual

◆ SetRelativeMipGap()

virtual void operations_research::MPSolverInterface::SetRelativeMipGap ( double value)
protectedpure virtual

◆ SetScalingMode()

virtual void operations_research::MPSolverInterface::SetScalingMode ( int value)
protectedpure virtual

◆ SetSolverSpecificParametersAsString()

bool operations_research::MPSolverInterface::SetSolverSpecificParametersAsString ( const std::string & parameters)
protectedvirtual

◆ SetStartingLpBasis()

◆ SetUnsupportedDoubleParam()

◆ SetUnsupportedIntegerParam()

◆ SetVariableBounds()

virtual void operations_research::MPSolverInterface::SetVariableBounds ( int index,
double lb,
double ub )
pure virtual

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.

◆ SetVariableInteger()

virtual void operations_research::MPSolverInterface::SetVariableInteger ( int index,
bool integer )
pure virtual

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.

◆ Solve()

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.

◆ SolverVersion()

virtual std::string operations_research::MPSolverInterface::SolverVersion ( ) const
pure virtual

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.

◆ SupportsCallbacks()

virtual bool operations_research::MPSolverInterface::SupportsCallbacks ( ) const
inlinevirtual

◆ SupportsDirectlySolveProto()

virtual bool operations_research::MPSolverInterface::SupportsDirectlySolveProto ( std::atomic< bool > * ) const
inlinevirtual

◆ underlying_solver()

virtual void * operations_research::MPSolverInterface::underlying_solver ( )
pure virtual

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.

◆ variable_is_extracted()

bool operations_research::MPSolverInterface::variable_is_extracted ( int var_index) const
inline

◆ Write()

void operations_research::MPSolverInterface::Write ( const std::string & filename)
virtual

◆ MPConstraint

friend class MPConstraint

friend

◆ MPObjective

◆ MPSolver

◆ best_objective_bound_

double operations_research::MPSolverInterface::best_objective_bound_

protected

◆ kDummyVariableIndex

const int operations_research::MPSolverInterface::kDummyVariableIndex = 0

staticprotected

◆ kUnknownNumberOfIterations

int64_t operations_research::MPSolverInterface::kUnknownNumberOfIterations = -1

staticconstexpr

◆ kUnknownNumberOfNodes

int64_t operations_research::MPSolverInterface::kUnknownNumberOfNodes = -1

staticconstexpr

◆ last_constraint_index_

int operations_research::MPSolverInterface::last_constraint_index_

protected

◆ last_variable_index_

int operations_research::MPSolverInterface::last_variable_index_

protected

◆ maximize_

bool operations_research::MPSolverInterface::maximize_

protected

◆ objective_value_

double operations_research::MPSolverInterface::objective_value_

protected

◆ quiet_

bool operations_research::MPSolverInterface::quiet_

protected

◆ result_status_

◆ solver_

MPSolver* const operations_research::MPSolverInterface::solver_

protected

◆ sync_status_

SynchronizationStatus operations_research::MPSolverInterface::sync_status_

protected

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