Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::glop::DataWrapper< MPModelProto > Class Reference

Public Types

using IndexType = int
 

Public Member Functions

 DataWrapper (MPModelProto *data)
 
void SetUp ()
 
void SetName (absl::string_view name)
 
void SetObjectiveDirection (bool maximize)
 
void SetObjectiveOffset (double objective_offset)
 
int FindOrCreateConstraint (absl::string_view name)
 
void SetConstraintBounds (int index, double lower_bound, double upper_bound)
 
void SetConstraintCoefficient (int row_index, int col_index, double coefficient)
 
void SetIsLazy (int row_index)
 
double ConstraintLowerBound (int row_index)
 
double ConstraintUpperBound (int row_index)
 
int FindOrCreateVariable (absl::string_view name)
 
void SetVariableTypeToInteger (int index)
 
void SetVariableTypeToSemiContinuous (int index)
 
void SetVariableBounds (int index, double lower_bound, double upper_bound)
 
void SetObjectiveCoefficient (int index, double coefficient)
 
double VariableLowerBound (int index)
 
double VariableUpperBound (int index)
 
absl::Status CreateIndicatorConstraint (absl::string_view cst_name, int var_index, bool var_value)
 
void CleanUp ()
 

Detailed Description

Definition at line 123 of file mps_reader.cc.

Member Typedef Documentation

◆ IndexType

using operations_research::glop::DataWrapper< MPModelProto >::IndexType = int

Definition at line 125 of file mps_reader.cc.

Constructor & Destructor Documentation

◆ DataWrapper()

operations_research::glop::DataWrapper< MPModelProto >::DataWrapper ( MPModelProto * data)
inlineexplicit

Definition at line 126 of file mps_reader.cc.

Member Function Documentation

◆ CleanUp()

void operations_research::glop::DataWrapper< MPModelProto >::CleanUp ( )
inline

We detect that the lower bound was not set when it is left to its default value of zero.

Create a new Boolean variable.

Todo
(user): Experiment with the switch constant.

bool_var == 0 implies var == 0.

bool_var == 1 implies lb <= var <= ub

var >= bool_var * lb

var <= bool_var * ub

Definition at line 234 of file mps_reader.cc.

◆ ConstraintLowerBound()

double operations_research::glop::DataWrapper< MPModelProto >::ConstraintLowerBound ( int row_index)
inline

Definition at line 173 of file mps_reader.cc.

◆ ConstraintUpperBound()

double operations_research::glop::DataWrapper< MPModelProto >::ConstraintUpperBound ( int row_index)
inline

Definition at line 176 of file mps_reader.cc.

◆ CreateIndicatorConstraint()

absl::Status operations_research::glop::DataWrapper< MPModelProto >::CreateIndicatorConstraint ( absl::string_view cst_name,
int var_index,
bool var_value )
inline

Definition at line 211 of file mps_reader.cc.

◆ FindOrCreateConstraint()

int operations_research::glop::DataWrapper< MPModelProto >::FindOrCreateConstraint ( absl::string_view name)
inline

Definition at line 144 of file mps_reader.cc.

◆ FindOrCreateVariable()

int operations_research::glop::DataWrapper< MPModelProto >::FindOrCreateVariable ( absl::string_view name)
inline

Definition at line 180 of file mps_reader.cc.

◆ SetConstraintBounds()

void operations_research::glop::DataWrapper< MPModelProto >::SetConstraintBounds ( int index,
double lower_bound,
double upper_bound )
inline

Definition at line 156 of file mps_reader.cc.

◆ SetConstraintCoefficient()

void operations_research::glop::DataWrapper< MPModelProto >::SetConstraintCoefficient ( int row_index,
int col_index,
double coefficient )
inline
Note
we assume that there is no duplicate in the mps file format. If there is, we will just add more than one entry from the same variable in a constraint, and we let any program that ingests an MPModelProto handle it.

Definition at line 160 of file mps_reader.cc.

◆ SetIsLazy()

void operations_research::glop::DataWrapper< MPModelProto >::SetIsLazy ( int row_index)
inline

Definition at line 170 of file mps_reader.cc.

◆ SetName()

void operations_research::glop::DataWrapper< MPModelProto >::SetName ( absl::string_view name)
inline

Definition at line 136 of file mps_reader.cc.

◆ SetObjectiveCoefficient()

void operations_research::glop::DataWrapper< MPModelProto >::SetObjectiveCoefficient ( int index,
double coefficient )
inline

Definition at line 201 of file mps_reader.cc.

◆ SetObjectiveDirection()

void operations_research::glop::DataWrapper< MPModelProto >::SetObjectiveDirection ( bool maximize)
inline

Definition at line 138 of file mps_reader.cc.

◆ SetObjectiveOffset()

void operations_research::glop::DataWrapper< MPModelProto >::SetObjectiveOffset ( double objective_offset)
inline

Definition at line 140 of file mps_reader.cc.

◆ SetUp()

void operations_research::glop::DataWrapper< MPModelProto >::SetUp ( )
inline

Definition at line 128 of file mps_reader.cc.

◆ SetVariableBounds()

void operations_research::glop::DataWrapper< MPModelProto >::SetVariableBounds ( int index,
double lower_bound,
double upper_bound )
inline

Definition at line 197 of file mps_reader.cc.

◆ SetVariableTypeToInteger()

void operations_research::glop::DataWrapper< MPModelProto >::SetVariableTypeToInteger ( int index)
inline

Definition at line 191 of file mps_reader.cc.

◆ SetVariableTypeToSemiContinuous()

void operations_research::glop::DataWrapper< MPModelProto >::SetVariableTypeToSemiContinuous ( int index)
inline

Definition at line 194 of file mps_reader.cc.

◆ VariableLowerBound()

double operations_research::glop::DataWrapper< MPModelProto >::VariableLowerBound ( int index)
inline

Definition at line 204 of file mps_reader.cc.

◆ VariableUpperBound()

double operations_research::glop::DataWrapper< MPModelProto >::VariableUpperBound ( int index)
inline

Definition at line 207 of file mps_reader.cc.


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