OR-Tools  9.6
ModelBuilderHelper

Detailed Description

Definition at line 46 of file model_builder_helper.h.

Public Member Functions

std::string ExportToMpsString (const operations_research::MPModelExportOptions &options=MPModelExportOptions())
 
std::string ExportToLpString (const operations_research::MPModelExportOptions &options=MPModelExportOptions())
 
bool WriteModelToFile (const std::string &filename)
 
bool ImportFromMpsString (const std::string &mps_string)
 
bool ImportFromMpsFile (const std::string &mps_file)
 
const MPModelProto & model () const
 
MPModelProto * mutable_model ()
 
int AddVar ()
 
void SetVarLowerBound (int var_index, double lb)
 
void SetVarUpperBound (int var_index, double ub)
 
void SetVarIntegrality (int var_index, bool is_integer)
 
void SetVarObjectiveCoefficient (int var_index, double coeff)
 
void SetVarName (int var_index, const std::string &name)
 
int AddLinearConstraint ()
 
void SetConstraintLowerBound (int ct_index, double lb)
 
void SetConstraintUpperBound (int ct_index, double ub)
 
void AddConstraintTerm (int ct_index, int var_index, double coeff)
 
void SetConstraintName (int ct_index, const std::string &name)
 
int num_variables () const
 
double VarLowerBound (int var_index) const
 
double VarUpperBound (int var_index) const
 
bool VarIsIntegral (int var_index) const
 
double VarObjectiveCoefficient (int var_index) const
 
std::string VarName (int var_index) const
 
int num_constraints () const
 
double ConstraintLowerBound (int ct_index) const
 
double ConstraintUpperBound (int ct_index) const
 
std::string ConstraintName (int ct_index) const
 
std::vector< int > ConstraintVarIndices (int ct_index) const
 
std::vector< double > ConstraintCoefficients (int ct_index) const
 
std::string name () const
 
void SetName (const std::string &name)
 
void ClearObjective ()
 
bool maximize () const
 
void SetMaximize (bool maximize)
 
double ObjectiveOffset () const
 
void SetObjectiveOffset (double offset)
 

Member Function Documentation

◆ AddConstraintTerm()

void AddConstraintTerm ( int  ct_index,
int  var_index,
double  coeff 
)

Definition at line 141 of file model_builder_helper.cc.

◆ AddLinearConstraint()

int AddLinearConstraint ( )

Definition at line 127 of file model_builder_helper.cc.

◆ AddVar()

int AddVar ( )

Definition at line 100 of file model_builder_helper.cc.

◆ ClearObjective()

void ClearObjective ( )

Definition at line 207 of file model_builder_helper.cc.

◆ ConstraintCoefficients()

std::vector< double > ConstraintCoefficients ( int  ct_index) const

Definition at line 196 of file model_builder_helper.cc.

◆ ConstraintLowerBound()

double ConstraintLowerBound ( int  ct_index) const

Definition at line 179 of file model_builder_helper.cc.

◆ ConstraintName()

std::string ConstraintName ( int  ct_index) const

Definition at line 187 of file model_builder_helper.cc.

◆ ConstraintUpperBound()

double ConstraintUpperBound ( int  ct_index) const

Definition at line 183 of file model_builder_helper.cc.

◆ ConstraintVarIndices()

std::vector< int > ConstraintVarIndices ( int  ct_index) const

Definition at line 191 of file model_builder_helper.cc.

◆ ExportToLpString()

std::string ExportToLpString ( const operations_research::MPModelExportOptions options = MPModelExportOptions())

Definition at line 44 of file model_builder_helper.cc.

◆ ExportToMpsString()

std::string ExportToMpsString ( const operations_research::MPModelExportOptions options = MPModelExportOptions())

Definition at line 38 of file model_builder_helper.cc.

◆ ImportFromMpsFile()

bool ImportFromMpsFile ( const std::string &  mps_file)

Definition at line 68 of file model_builder_helper.cc.

◆ ImportFromMpsString()

bool ImportFromMpsString ( const std::string &  mps_string)

Definition at line 60 of file model_builder_helper.cc.

◆ maximize()

bool maximize ( ) const

Definition at line 213 of file model_builder_helper.cc.

◆ model()

const MPModelProto & model ( ) const

Definition at line 96 of file model_builder_helper.cc.

◆ mutable_model()

MPModelProto * mutable_model ( )

Definition at line 98 of file model_builder_helper.cc.

◆ name()

std::string name ( ) const

Definition at line 202 of file model_builder_helper.cc.

◆ num_constraints()

int num_constraints ( ) const

Definition at line 175 of file model_builder_helper.cc.

◆ num_variables()

int num_variables ( ) const

Definition at line 153 of file model_builder_helper.cc.

◆ ObjectiveOffset()

double ObjectiveOffset ( ) const

Definition at line 219 of file model_builder_helper.cc.

◆ SetConstraintLowerBound()

void SetConstraintLowerBound ( int  ct_index,
double  lb 
)

Definition at line 133 of file model_builder_helper.cc.

◆ SetConstraintName()

void SetConstraintName ( int  ct_index,
const std::string &  name 
)

Definition at line 148 of file model_builder_helper.cc.

◆ SetConstraintUpperBound()

void SetConstraintUpperBound ( int  ct_index,
double  ub 
)

Definition at line 137 of file model_builder_helper.cc.

◆ SetMaximize()

void SetMaximize ( bool  maximize)

Definition at line 215 of file model_builder_helper.cc.

◆ SetName()

void SetName ( const std::string &  name)

Definition at line 204 of file model_builder_helper.cc.

◆ SetObjectiveOffset()

void SetObjectiveOffset ( double  offset)

Definition at line 223 of file model_builder_helper.cc.

◆ SetVarIntegrality()

void SetVarIntegrality ( int  var_index,
bool  is_integer 
)

Definition at line 114 of file model_builder_helper.cc.

◆ SetVarLowerBound()

void SetVarLowerBound ( int  var_index,
double  lb 
)

Definition at line 106 of file model_builder_helper.cc.

◆ SetVarName()

void SetVarName ( int  var_index,
const std::string &  name 
)

Definition at line 123 of file model_builder_helper.cc.

◆ SetVarObjectiveCoefficient()

void SetVarObjectiveCoefficient ( int  var_index,
double  coeff 
)

Definition at line 118 of file model_builder_helper.cc.

◆ SetVarUpperBound()

void SetVarUpperBound ( int  var_index,
double  ub 
)

Definition at line 110 of file model_builder_helper.cc.

◆ VarIsIntegral()

bool VarIsIntegral ( int  var_index) const

Definition at line 163 of file model_builder_helper.cc.

◆ VarLowerBound()

double VarLowerBound ( int  var_index) const

Definition at line 155 of file model_builder_helper.cc.

◆ VarName()

std::string VarName ( int  var_index) const

Definition at line 171 of file model_builder_helper.cc.

◆ VarObjectiveCoefficient()

double VarObjectiveCoefficient ( int  var_index) const

Definition at line 167 of file model_builder_helper.cc.

◆ VarUpperBound()

double VarUpperBound ( int  var_index) const

Definition at line 159 of file model_builder_helper.cc.

◆ WriteModelToFile()

bool WriteModelToFile ( const std::string &  filename)

Definition at line 50 of file model_builder_helper.cc.


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