OR-Tools  9.6
Model

Detailed Description

Definition at line 110 of file math_opt/cpp/model.h.

Public Member Functions

 Model (absl::string_view name="")
 
 Model (std::unique_ptr< ModelStorage > storage)
 
 Model (const Model &)=delete
 
Modeloperator= (const Model &)=delete
 
std::unique_ptr< ModelClone (std::optional< absl::string_view > new_name=std::nullopt) const
 
const std::string & name () const
 
Variable AddVariable (double lower_bound, double upper_bound, bool is_integer, absl::string_view name="")
 
Variable AddVariable (absl::string_view name="")
 
Variable AddBinaryVariable (absl::string_view name="")
 
Variable AddContinuousVariable (double lower_bound, double upper_bound, absl::string_view name="")
 
Variable AddIntegerVariable (double lower_bound, double upper_bound, absl::string_view name="")
 
void DeleteVariable (Variable variable)
 
int num_variables () const
 
int64_t next_variable_id () const
 
bool has_variable (int64_t id) const
 
bool has_variable (VariableId id) const
 
Variable variable (int64_t id) const
 
Variable variable (VariableId id) const
 
const std::string & name (Variable variable) const
 
void set_lower_bound (Variable variable, double lower_bound)
 
double lower_bound (Variable variable) const
 
void set_upper_bound (Variable variable, double upper_bound)
 
double upper_bound (Variable variable) const
 
void set_is_integer (Variable variable, bool is_integer)
 
void set_integer (Variable variable)
 
void set_continuous (Variable variable)
 
bool is_integer (Variable variable) const
 
std::vector< VariableVariables () const
 
std::vector< VariableSortedVariables () const
 
absl::Status ValidateExistingVariableOfThisModel (Variable variable) const
 
std::vector< LinearConstraintColumnNonzeros (Variable variable) const
 
LinearConstraint AddLinearConstraint (absl::string_view name="")
 
LinearConstraint AddLinearConstraint (double lower_bound, double upper_bound, absl::string_view name="")
 
LinearConstraint AddLinearConstraint (const BoundedLinearExpression &bounded_expr, absl::string_view name="")
 
void DeleteLinearConstraint (LinearConstraint constraint)
 
int num_linear_constraints () const
 
int64_t next_linear_constraint_id () const
 
bool has_linear_constraint (int64_t id) const
 
bool has_linear_constraint (LinearConstraintId id) const
 
LinearConstraint linear_constraint (int64_t id) const
 
LinearConstraint linear_constraint (LinearConstraintId id) const
 
const std::string & name (LinearConstraint constraint) const
 
void set_lower_bound (LinearConstraint constraint, double lower_bound)
 
double lower_bound (LinearConstraint constraint) const
 
void set_upper_bound (LinearConstraint constraint, double upper_bound)
 
double upper_bound (LinearConstraint constraint) const
 
void set_coefficient (LinearConstraint constraint, Variable variable, double value)
 
double coefficient (LinearConstraint constraint, Variable variable) const
 
bool is_coefficient_nonzero (LinearConstraint constraint, Variable variable) const
 
std::vector< VariableRowNonzeros (LinearConstraint constraint) const
 
std::vector< LinearConstraintLinearConstraints () const
 
std::vector< LinearConstraintSortedLinearConstraints () const
 
absl::Status ValidateExistingLinearConstraintOfThisModel (LinearConstraint linear_constraint) const
 
QuadraticConstraint AddQuadraticConstraint (const BoundedQuadraticExpression &bounded_expr, absl::string_view name="")
 
void DeleteQuadraticConstraint (QuadraticConstraint constraint)
 
int64_t num_quadratic_constraints () const
 
int64_t next_quadratic_constraint_id () const
 
bool has_quadratic_constraint (int64_t id) const
 
bool has_quadratic_constraint (QuadraticConstraintId id) const
 
QuadraticConstraint quadratic_constraint (int64_t id) const
 
QuadraticConstraint quadratic_constraint (QuadraticConstraintId id) const
 
std::vector< QuadraticConstraintQuadraticConstraints () const
 
std::vector< QuadraticConstraintSortedQuadraticConstraints () const
 
Sos1Constraint AddSos1Constraint (const std::vector< LinearExpression > &expressions, std::vector< double > weights={}, absl::string_view name="")
 
void DeleteSos1Constraint (Sos1Constraint constraint)
 
int64_t num_sos1_constraints () const
 
int64_t next_sos1_constraint_id () const
 
bool has_sos1_constraint (int64_t id) const
 
bool has_sos1_constraint (Sos1ConstraintId id) const
 
Sos1Constraint sos1_constraint (int64_t id) const
 
Sos1Constraint sos1_constraint (Sos1ConstraintId id) const
 
std::vector< Sos1ConstraintSos1Constraints () const
 
std::vector< Sos1ConstraintSortedSos1Constraints () const
 
Sos2Constraint AddSos2Constraint (const std::vector< LinearExpression > &expressions, std::vector< double > weights={}, absl::string_view name="")
 
void DeleteSos2Constraint (Sos2Constraint constraint)
 
int64_t num_sos2_constraints () const
 
int64_t next_sos2_constraint_id () const
 
bool has_sos2_constraint (int64_t id) const
 
bool has_sos2_constraint (Sos2ConstraintId id) const
 
Sos2Constraint sos2_constraint (int64_t id) const
 
Sos2Constraint sos2_constraint (Sos2ConstraintId id) const
 
std::vector< Sos2ConstraintSos2Constraints () const
 
std::vector< Sos2ConstraintSortedSos2Constraints () const
 
IndicatorConstraint AddIndicatorConstraint (Variable indicator_variable, const BoundedLinearExpression &implied_constraint, bool activate_on_zero=false, absl::string_view name={})
 
void DeleteIndicatorConstraint (IndicatorConstraint constraint)
 
int64_t num_indicator_constraints () const
 
int64_t next_indicator_constraint_id () const
 
bool has_indicator_constraint (int64_t id) const
 
bool has_indicator_constraint (IndicatorConstraintId id) const
 
IndicatorConstraint indicator_constraint (int64_t id) const
 
IndicatorConstraint indicator_constraint (IndicatorConstraintId id) const
 
std::vector< IndicatorConstraintIndicatorConstraints () const
 
std::vector< IndicatorConstraintSortedIndicatorConstraints () const
 
void Maximize (double objective)
 
void Maximize (Variable objective)
 
void Maximize (LinearTerm objective)
 
void Maximize (const LinearExpression &objective)
 
void Maximize (const QuadraticExpression &objective)
 
void Minimize (double objective)
 
void Minimize (Variable objective)
 
void Minimize (LinearTerm objective)
 
void Minimize (const LinearExpression &objective)
 
void Minimize (const QuadraticExpression &objective)
 
void SetObjective (double objective, bool is_maximize)
 
void SetObjective (Variable objective, bool is_maximize)
 
void SetObjective (LinearTerm objective, bool is_maximize)
 
void SetObjective (const LinearExpression &objective, bool is_maximize)
 
void SetObjective (const QuadraticExpression &objective, bool is_maximize)
 
void AddToObjective (double objective)
 
void AddToObjective (Variable objective)
 
void AddToObjective (LinearTerm objective)
 
void AddToObjective (const LinearExpression &objective)
 
void AddToObjective (const QuadraticExpression &objective)
 
LinearExpression ObjectiveAsLinearExpression () const
 
QuadraticExpression ObjectiveAsQuadraticExpression () const
 
double objective_coefficient (Variable variable) const
 
double objective_coefficient (Variable first_variable, Variable second_variable) const
 
void set_objective_coefficient (Variable variable, double value)
 
void set_objective_coefficient (Variable first_variable, Variable second_variable, double value)
 
void clear_objective ()
 
bool is_objective_coefficient_nonzero (Variable variable) const
 
bool is_objective_coefficient_nonzero (Variable first_variable, Variable second_variable) const
 
double objective_offset () const
 
void set_objective_offset (double value)
 
bool is_maximize () const
 
void set_maximize ()
 
void set_minimize ()
 
void set_is_maximize (bool is_maximize)
 
ModelProto ExportModel () const
 
std::unique_ptr< UpdateTrackerNewUpdateTracker ()
 
absl::Status ApplyUpdateProto (const ModelUpdateProto &update_proto)
 
const ModelStoragestorage () const
 
ModelStoragestorage ()
 

Static Public Member Functions

static absl::StatusOr< std::unique_ptr< Model > > FromModelProto (const ModelProto &model_proto)
 

Constructor & Destructor Documentation

◆ Model() [1/3]

Model ( absl::string_view  name = "")
explicit

Definition at line 56 of file math_opt/cpp/model.cc.

◆ Model() [2/3]

Model ( std::unique_ptr< ModelStorage storage)
explicit

Definition at line 59 of file math_opt/cpp/model.cc.

◆ Model() [3/3]

Model ( const Model )
delete

Member Function Documentation

◆ AddBinaryVariable()

Variable AddBinaryVariable ( absl::string_view  name = "")
inline

Definition at line 773 of file math_opt/cpp/model.h.

◆ AddContinuousVariable()

Variable AddContinuousVariable ( double  lower_bound,
double  upper_bound,
absl::string_view  name = "" 
)
inline

Definition at line 777 of file math_opt/cpp/model.h.

◆ AddIndicatorConstraint()

IndicatorConstraint AddIndicatorConstraint ( Variable  indicator_variable,
const BoundedLinearExpression implied_constraint,
bool  activate_on_zero = false,
absl::string_view  name = {} 
)

Definition at line 371 of file math_opt/cpp/model.cc.

◆ AddIntegerVariable()

Variable AddIntegerVariable ( double  lower_bound,
double  upper_bound,
absl::string_view  name = "" 
)
inline

Definition at line 783 of file math_opt/cpp/model.h.

◆ AddLinearConstraint() [1/3]

LinearConstraint AddLinearConstraint ( absl::string_view  name = "")
inline

Definition at line 878 of file math_opt/cpp/model.h.

◆ AddLinearConstraint() [2/3]

LinearConstraint AddLinearConstraint ( const BoundedLinearExpression bounded_expr,
absl::string_view  name = "" 
)

Definition at line 67 of file math_opt/cpp/model.cc.

◆ AddLinearConstraint() [3/3]

LinearConstraint AddLinearConstraint ( double  lower_bound,
double  upper_bound,
absl::string_view  name = "" 
)
inline

Definition at line 881 of file math_opt/cpp/model.h.

◆ AddQuadraticConstraint()

QuadraticConstraint AddQuadraticConstraint ( const BoundedQuadraticExpression bounded_expr,
absl::string_view  name = "" 
)

Definition at line 298 of file math_opt/cpp/model.cc.

◆ AddSos1Constraint()

Sos1Constraint AddSos1Constraint ( const std::vector< LinearExpression > &  expressions,
std::vector< double >  weights = {},
absl::string_view  name = "" 
)

Definition at line 345 of file math_opt/cpp/model.cc.

◆ AddSos2Constraint()

Sos2Constraint AddSos2Constraint ( const std::vector< LinearExpression > &  expressions,
std::vector< double >  weights = {},
absl::string_view  name = "" 
)

Definition at line 358 of file math_opt/cpp/model.cc.

◆ AddToObjective() [1/5]

void AddToObjective ( const LinearExpression objective)

Definition at line 164 of file math_opt/cpp/model.cc.

◆ AddToObjective() [2/5]

void AddToObjective ( const QuadraticExpression objective)

Definition at line 174 of file math_opt/cpp/model.cc.

◆ AddToObjective() [3/5]

void AddToObjective ( double  objective)
inline

Definition at line 1198 of file math_opt/cpp/model.h.

◆ AddToObjective() [4/5]

void AddToObjective ( LinearTerm  objective)
inline

Definition at line 1204 of file math_opt/cpp/model.h.

◆ AddToObjective() [5/5]

void AddToObjective ( Variable  objective)
inline

Definition at line 1201 of file math_opt/cpp/model.h.

◆ AddVariable() [1/2]

Variable AddVariable ( absl::string_view  name = "")
inline

Definition at line 763 of file math_opt/cpp/model.h.

◆ AddVariable() [2/2]

Variable AddVariable ( double  lower_bound,
double  upper_bound,
bool  is_integer,
absl::string_view  name = "" 
)
inline

Definition at line 766 of file math_opt/cpp/model.h.

◆ ApplyUpdateProto()

absl::Status ApplyUpdateProto ( const ModelUpdateProto &  update_proto)

Definition at line 219 of file math_opt/cpp/model.cc.

◆ clear_objective()

void clear_objective ( )
inline

Definition at line 1236 of file math_opt/cpp/model.h.

◆ Clone()

std::unique_ptr< Model > Clone ( std::optional< absl::string_view >  new_name = std::nullopt) const

Definition at line 62 of file math_opt/cpp/model.cc.

◆ coefficient()

double coefficient ( LinearConstraint  constraint,
Variable  variable 
) const
inline

Definition at line 972 of file math_opt/cpp/model.h.

◆ ColumnNonzeros()

std::vector< LinearConstraint > ColumnNonzeros ( Variable  variable) const

Definition at line 98 of file math_opt/cpp/model.cc.

◆ DeleteIndicatorConstraint()

void DeleteIndicatorConstraint ( IndicatorConstraint  constraint)
inline

Definition at line 1114 of file math_opt/cpp/model.h.

◆ DeleteLinearConstraint()

void DeleteLinearConstraint ( LinearConstraint  constraint)
inline

Definition at line 888 of file math_opt/cpp/model.h.

◆ DeleteQuadraticConstraint()

void DeleteQuadraticConstraint ( QuadraticConstraint  constraint)
inline

Definition at line 990 of file math_opt/cpp/model.h.

◆ DeleteSos1Constraint()

void DeleteSos1Constraint ( Sos1Constraint  constraint)
inline

Definition at line 1032 of file math_opt/cpp/model.h.

◆ DeleteSos2Constraint()

void DeleteSos2Constraint ( Sos2Constraint  constraint)
inline

Definition at line 1073 of file math_opt/cpp/model.h.

◆ DeleteVariable()

void DeleteVariable ( Variable  variable)
inline

Definition at line 789 of file math_opt/cpp/model.h.

◆ ExportModel()

ModelProto ExportModel ( ) const

Definition at line 213 of file math_opt/cpp/model.cc.

◆ FromModelProto()

absl::StatusOr< std::unique_ptr< Model > > FromModelProto ( const ModelProto &  model_proto)
static

Definition at line 49 of file math_opt/cpp/model.cc.

◆ has_indicator_constraint() [1/2]

bool has_indicator_constraint ( IndicatorConstraintId  id) const
inline

Definition at line 1131 of file math_opt/cpp/model.h.

◆ has_indicator_constraint() [2/2]

bool has_indicator_constraint ( int64_t  id) const
inline

Definition at line 1127 of file math_opt/cpp/model.h.

◆ has_linear_constraint() [1/2]

bool has_linear_constraint ( int64_t  id) const
inline

Definition at line 901 of file math_opt/cpp/model.h.

◆ has_linear_constraint() [2/2]

bool has_linear_constraint ( LinearConstraintId  id) const
inline

Definition at line 905 of file math_opt/cpp/model.h.

◆ has_quadratic_constraint() [1/2]

bool has_quadratic_constraint ( int64_t  id) const
inline

Definition at line 1003 of file math_opt/cpp/model.h.

◆ has_quadratic_constraint() [2/2]

bool has_quadratic_constraint ( QuadraticConstraintId  id) const
inline

Definition at line 1007 of file math_opt/cpp/model.h.

◆ has_sos1_constraint() [1/2]

bool has_sos1_constraint ( int64_t  id) const
inline

Definition at line 1045 of file math_opt/cpp/model.h.

◆ has_sos1_constraint() [2/2]

bool has_sos1_constraint ( Sos1ConstraintId  id) const
inline

Definition at line 1049 of file math_opt/cpp/model.h.

◆ has_sos2_constraint() [1/2]

bool has_sos2_constraint ( int64_t  id) const
inline

Definition at line 1086 of file math_opt/cpp/model.h.

◆ has_sos2_constraint() [2/2]

bool has_sos2_constraint ( Sos2ConstraintId  id) const
inline

Definition at line 1090 of file math_opt/cpp/model.h.

◆ has_variable() [1/2]

bool has_variable ( int64_t  id) const
inline

Definition at line 800 of file math_opt/cpp/model.h.

◆ has_variable() [2/2]

bool has_variable ( VariableId  id) const
inline

Definition at line 804 of file math_opt/cpp/model.h.

◆ indicator_constraint() [1/2]

IndicatorConstraint indicator_constraint ( IndicatorConstraintId  id) const
inline

Definition at line 1139 of file math_opt/cpp/model.h.

◆ indicator_constraint() [2/2]

IndicatorConstraint indicator_constraint ( int64_t  id) const
inline

Definition at line 1135 of file math_opt/cpp/model.h.

◆ IndicatorConstraints()

std::vector< IndicatorConstraint > IndicatorConstraints ( ) const
inline

Definition at line 1146 of file math_opt/cpp/model.h.

◆ is_coefficient_nonzero()

bool is_coefficient_nonzero ( LinearConstraint  constraint,
Variable  variable 
) const
inline

Definition at line 980 of file math_opt/cpp/model.h.

◆ is_integer()

bool is_integer ( Variable  variable) const
inline

Definition at line 855 of file math_opt/cpp/model.h.

◆ is_maximize()

bool is_maximize ( ) const
inline

Definition at line 1258 of file math_opt/cpp/model.h.

◆ is_objective_coefficient_nonzero() [1/2]

bool is_objective_coefficient_nonzero ( Variable  first_variable,
Variable  second_variable 
) const
inline

Definition at line 1244 of file math_opt/cpp/model.h.

◆ is_objective_coefficient_nonzero() [2/2]

bool is_objective_coefficient_nonzero ( Variable  variable) const
inline

Definition at line 1238 of file math_opt/cpp/model.h.

◆ linear_constraint() [1/2]

LinearConstraint linear_constraint ( int64_t  id) const
inline

Definition at line 909 of file math_opt/cpp/model.h.

◆ linear_constraint() [2/2]

LinearConstraint linear_constraint ( LinearConstraintId  id) const
inline

Definition at line 913 of file math_opt/cpp/model.h.

◆ LinearConstraints()

std::vector< LinearConstraint > LinearConstraints ( ) const

Definition at line 120 of file math_opt/cpp/model.cc.

◆ lower_bound() [1/2]

double lower_bound ( LinearConstraint  constraint) const
inline

Definition at line 931 of file math_opt/cpp/model.h.

◆ lower_bound() [2/2]

double lower_bound ( Variable  variable) const
inline

Definition at line 827 of file math_opt/cpp/model.h.

◆ Maximize() [1/5]

void Maximize ( const LinearExpression objective)
inline

Definition at line 1165 of file math_opt/cpp/model.h.

◆ Maximize() [2/5]

void Maximize ( const QuadraticExpression objective)
inline

Definition at line 1168 of file math_opt/cpp/model.h.

◆ Maximize() [3/5]

void Maximize ( double  objective)
inline

Definition at line 1156 of file math_opt/cpp/model.h.

◆ Maximize() [4/5]

void Maximize ( LinearTerm  objective)
inline

Definition at line 1162 of file math_opt/cpp/model.h.

◆ Maximize() [5/5]

void Maximize ( Variable  objective)
inline

Definition at line 1159 of file math_opt/cpp/model.h.

◆ Minimize() [1/5]

void Minimize ( const LinearExpression objective)
inline

Definition at line 1181 of file math_opt/cpp/model.h.

◆ Minimize() [2/5]

void Minimize ( const QuadraticExpression objective)
inline

Definition at line 1184 of file math_opt/cpp/model.h.

◆ Minimize() [3/5]

void Minimize ( double  objective)
inline

Definition at line 1172 of file math_opt/cpp/model.h.

◆ Minimize() [4/5]

void Minimize ( LinearTerm  objective)
inline

Definition at line 1178 of file math_opt/cpp/model.h.

◆ Minimize() [5/5]

void Minimize ( Variable  objective)
inline

Definition at line 1175 of file math_opt/cpp/model.h.

◆ name() [1/3]

const std::string & name ( ) const
inline

Definition at line 761 of file math_opt/cpp/model.h.

◆ name() [2/3]

const std::string & name ( LinearConstraint  constraint) const
inline

Definition at line 919 of file math_opt/cpp/model.h.

◆ name() [3/3]

const std::string & name ( Variable  variable) const
inline

Definition at line 817 of file math_opt/cpp/model.h.

◆ NewUpdateTracker()

std::unique_ptr< UpdateTracker > NewUpdateTracker ( )

Definition at line 215 of file math_opt/cpp/model.cc.

◆ next_indicator_constraint_id()

int64_t next_indicator_constraint_id ( ) const
inline

Definition at line 1123 of file math_opt/cpp/model.h.

◆ next_linear_constraint_id()

int64_t next_linear_constraint_id ( ) const
inline

Definition at line 897 of file math_opt/cpp/model.h.

◆ next_quadratic_constraint_id()

int64_t next_quadratic_constraint_id ( ) const
inline

Definition at line 999 of file math_opt/cpp/model.h.

◆ next_sos1_constraint_id()

int64_t next_sos1_constraint_id ( ) const
inline

Definition at line 1041 of file math_opt/cpp/model.h.

◆ next_sos2_constraint_id()

int64_t next_sos2_constraint_id ( ) const
inline

Definition at line 1082 of file math_opt/cpp/model.h.

◆ next_variable_id()

int64_t next_variable_id ( ) const
inline

Definition at line 796 of file math_opt/cpp/model.h.

◆ num_indicator_constraints()

int64_t num_indicator_constraints ( ) const
inline

Definition at line 1119 of file math_opt/cpp/model.h.

◆ num_linear_constraints()

int num_linear_constraints ( ) const
inline

Definition at line 893 of file math_opt/cpp/model.h.

◆ num_quadratic_constraints()

int64_t num_quadratic_constraints ( ) const
inline

Definition at line 995 of file math_opt/cpp/model.h.

◆ num_sos1_constraints()

int64_t num_sos1_constraints ( ) const
inline

Definition at line 1037 of file math_opt/cpp/model.h.

◆ num_sos2_constraints()

int64_t num_sos2_constraints ( ) const
inline

Definition at line 1078 of file math_opt/cpp/model.h.

◆ num_variables()

int num_variables ( ) const
inline

Definition at line 794 of file math_opt/cpp/model.h.

◆ objective_coefficient() [1/2]

double objective_coefficient ( Variable  first_variable,
Variable  second_variable 
) const
inline

Definition at line 1213 of file math_opt/cpp/model.h.

◆ objective_coefficient() [2/2]

double objective_coefficient ( Variable  variable) const
inline

Definition at line 1208 of file math_opt/cpp/model.h.

◆ objective_offset()

double objective_offset ( ) const
inline

Definition at line 1252 of file math_opt/cpp/model.h.

◆ ObjectiveAsLinearExpression()

LinearExpression ObjectiveAsLinearExpression ( ) const

Definition at line 190 of file math_opt/cpp/model.cc.

◆ ObjectiveAsQuadraticExpression()

QuadraticExpression ObjectiveAsQuadraticExpression ( ) const

Definition at line 201 of file math_opt/cpp/model.cc.

◆ operator=()

Model& operator= ( const Model )
delete

◆ quadratic_constraint() [1/2]

QuadraticConstraint quadratic_constraint ( int64_t  id) const
inline

Definition at line 1011 of file math_opt/cpp/model.h.

◆ quadratic_constraint() [2/2]

QuadraticConstraint quadratic_constraint ( QuadraticConstraintId  id) const
inline

Definition at line 1015 of file math_opt/cpp/model.h.

◆ QuadraticConstraints()

std::vector< QuadraticConstraint > QuadraticConstraints ( ) const
inline

Definition at line 1022 of file math_opt/cpp/model.h.

◆ RowNonzeros()

std::vector< Variable > RowNonzeros ( LinearConstraint  constraint) const

Definition at line 109 of file math_opt/cpp/model.cc.

◆ set_coefficient()

void set_coefficient ( LinearConstraint  constraint,
Variable  variable,
double  value 
)
inline

Definition at line 964 of file math_opt/cpp/model.h.

◆ set_continuous()

void set_continuous ( Variable  variable)
inline

Definition at line 851 of file math_opt/cpp/model.h.

◆ set_integer()

void set_integer ( Variable  variable)
inline

Definition at line 847 of file math_opt/cpp/model.h.

◆ set_is_integer()

void set_is_integer ( Variable  variable,
bool  is_integer 
)
inline

Definition at line 842 of file math_opt/cpp/model.h.

◆ set_is_maximize()

void set_is_maximize ( bool  is_maximize)
inline

Definition at line 1264 of file math_opt/cpp/model.h.

◆ set_lower_bound() [1/2]

void set_lower_bound ( LinearConstraint  constraint,
double  lower_bound 
)
inline

Definition at line 924 of file math_opt/cpp/model.h.

◆ set_lower_bound() [2/2]

void set_lower_bound ( Variable  variable,
double  lower_bound 
)
inline

Definition at line 822 of file math_opt/cpp/model.h.

◆ set_maximize()

void set_maximize ( )
inline

Definition at line 1260 of file math_opt/cpp/model.h.

◆ set_minimize()

void set_minimize ( )
inline

Definition at line 1262 of file math_opt/cpp/model.h.

◆ set_objective_coefficient() [1/2]

void set_objective_coefficient ( Variable  first_variable,
Variable  second_variable,
double  value 
)
inline

Definition at line 1227 of file math_opt/cpp/model.h.

◆ set_objective_coefficient() [2/2]

void set_objective_coefficient ( Variable  variable,
double  value 
)
inline

Definition at line 1221 of file math_opt/cpp/model.h.

◆ set_objective_offset()

void set_objective_offset ( double  value)
inline

Definition at line 1254 of file math_opt/cpp/model.h.

◆ set_upper_bound() [1/2]

void set_upper_bound ( LinearConstraint  constraint,
double  upper_bound 
)
inline

Definition at line 936 of file math_opt/cpp/model.h.

◆ set_upper_bound() [2/2]

void set_upper_bound ( Variable  variable,
double  upper_bound 
)
inline

Definition at line 832 of file math_opt/cpp/model.h.

◆ SetObjective() [1/5]

void SetObjective ( const LinearExpression objective,
bool  is_maximize 
)

Definition at line 138 of file math_opt/cpp/model.cc.

◆ SetObjective() [2/5]

void SetObjective ( const QuadraticExpression objective,
bool  is_maximize 
)

Definition at line 149 of file math_opt/cpp/model.cc.

◆ SetObjective() [3/5]

void SetObjective ( double  objective,
bool  is_maximize 
)
inline

Definition at line 1188 of file math_opt/cpp/model.h.

◆ SetObjective() [4/5]

void SetObjective ( LinearTerm  objective,
bool  is_maximize 
)
inline

Definition at line 1194 of file math_opt/cpp/model.h.

◆ SetObjective() [5/5]

void SetObjective ( Variable  objective,
bool  is_maximize 
)
inline

Definition at line 1191 of file math_opt/cpp/model.h.

◆ SortedIndicatorConstraints()

std::vector< IndicatorConstraint > SortedIndicatorConstraints ( ) const
inline

Definition at line 1150 of file math_opt/cpp/model.h.

◆ SortedLinearConstraints()

std::vector< LinearConstraint > SortedLinearConstraints ( ) const

Definition at line 129 of file math_opt/cpp/model.cc.

◆ SortedQuadraticConstraints()

std::vector< QuadraticConstraint > SortedQuadraticConstraints ( ) const
inline

Definition at line 1026 of file math_opt/cpp/model.h.

◆ SortedSos1Constraints()

std::vector< Sos1Constraint > SortedSos1Constraints ( ) const
inline

Definition at line 1067 of file math_opt/cpp/model.h.

◆ SortedSos2Constraints()

std::vector< Sos2Constraint > SortedSos2Constraints ( ) const
inline

Definition at line 1108 of file math_opt/cpp/model.h.

◆ SortedVariables()

std::vector< Variable > SortedVariables ( ) const

Definition at line 89 of file math_opt/cpp/model.cc.

◆ sos1_constraint() [1/2]

Sos1Constraint sos1_constraint ( int64_t  id) const
inline

Definition at line 1053 of file math_opt/cpp/model.h.

◆ sos1_constraint() [2/2]

Sos1Constraint sos1_constraint ( Sos1ConstraintId  id) const
inline

Definition at line 1057 of file math_opt/cpp/model.h.

◆ Sos1Constraints()

std::vector< Sos1Constraint > Sos1Constraints ( ) const
inline

Definition at line 1063 of file math_opt/cpp/model.h.

◆ sos2_constraint() [1/2]

Sos2Constraint sos2_constraint ( int64_t  id) const
inline

Definition at line 1094 of file math_opt/cpp/model.h.

◆ sos2_constraint() [2/2]

Sos2Constraint sos2_constraint ( Sos2ConstraintId  id) const
inline

Definition at line 1098 of file math_opt/cpp/model.h.

◆ Sos2Constraints()

std::vector< Sos2Constraint > Sos2Constraints ( ) const
inline

Definition at line 1104 of file math_opt/cpp/model.h.

◆ storage() [1/2]

ModelStorage* storage ( )
inline

Definition at line 727 of file math_opt/cpp/model.h.

◆ storage() [2/2]

const ModelStorage* storage ( ) const
inline

Definition at line 721 of file math_opt/cpp/model.h.

◆ upper_bound() [1/2]

double upper_bound ( LinearConstraint  constraint) const
inline

Definition at line 943 of file math_opt/cpp/model.h.

◆ upper_bound() [2/2]

double upper_bound ( Variable  variable) const
inline

Definition at line 837 of file math_opt/cpp/model.h.

◆ ValidateExistingLinearConstraintOfThisModel()

absl::Status ValidateExistingLinearConstraintOfThisModel ( LinearConstraint  linear_constraint) const
inline

Definition at line 948 of file math_opt/cpp/model.h.

◆ ValidateExistingVariableOfThisModel()

absl::Status ValidateExistingVariableOfThisModel ( Variable  variable) const
inline

Definition at line 862 of file math_opt/cpp/model.h.

◆ variable() [1/2]

Variable variable ( int64_t  id) const
inline

Definition at line 808 of file math_opt/cpp/model.h.

◆ variable() [2/2]

Variable variable ( VariableId  id) const
inline

Definition at line 812 of file math_opt/cpp/model.h.

◆ Variables()

std::vector< Variable > Variables ( ) const

Definition at line 80 of file math_opt/cpp/model.cc.


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