Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::mb::Variable Class Reference

A class to hold a variable index. More...

#include <model_builder_helper.h>

Inheritance diagram for operations_research::mb::Variable:
operations_research::mb::LinearExpr

Public Member Functions

 Variable (ModelBuilderHelper *helper, int index)
 
 Variable (ModelBuilderHelper *helper, double lb, double ub, bool is_integral)
 
 Variable (ModelBuilderHelper *helper, double lb, double ub, bool is_integral, const std::string &name)
 
 Variable (ModelBuilderHelper *helper, int64_t lb, int64_t ub, bool is_integral)
 
 Variable (ModelBuilderHelper *helper, int64_t lb, int64_t ub, bool is_integral, const std::string &name)
 
 ~Variable () override
 
ModelBuilderHelperhelper () const
 
int index () const
 
std::string name () const
 
void SetName (const std::string &name)
 
double lower_bounds () const
 
void SetLowerBound (double lb)
 
double upper_bound () const
 
void SetUpperBound (double ub)
 
bool is_integral () const
 
void SetIsIntegral (bool is_integral)
 
double objective_coefficient () const
 
void SetObjectiveCoefficient (double coeff)
 
void Visit (ExprVisitor &lin, double c) override
 
std::string ToString () const override
 
std::string DebugString () const override
 
bool operator< (const Variable &other) const
 
- Public Member Functions inherited from operations_research::mb::LinearExpr
virtual ~LinearExpr ()=default
 
std::shared_ptr< LinearExprAdd (std::shared_ptr< LinearExpr > expr)
 
std::shared_ptr< LinearExprAddFloat (double cst)
 
std::shared_ptr< LinearExprSub (std::shared_ptr< LinearExpr > expr)
 
std::shared_ptr< LinearExprSubFloat (double cst)
 
std::shared_ptr< LinearExprRSubFloat (double cst)
 
std::shared_ptr< LinearExprMulFloat (double cst)
 
std::shared_ptr< LinearExprNeg ()
 
std::shared_ptr< BoundedLinearExpressionEq (std::shared_ptr< LinearExpr > rhs)
 
std::shared_ptr< BoundedLinearExpressionEqCst (double rhs)
 
std::shared_ptr< BoundedLinearExpressionGe (std::shared_ptr< LinearExpr > rhs)
 
std::shared_ptr< BoundedLinearExpressionGeCst (double rhs)
 
std::shared_ptr< BoundedLinearExpressionLe (std::shared_ptr< LinearExpr > rhs)
 
std::shared_ptr< BoundedLinearExpressionLeCst (double rhs)
 

Protected Attributes

ModelBuilderHelperhelper_
 
int index_
 

Additional Inherited Members

- Static Public Member Functions inherited from operations_research::mb::LinearExpr
static std::shared_ptr< LinearExprTerm (std::shared_ptr< LinearExpr > expr, double coeff)
 Expressions.
 
static std::shared_ptr< LinearExprAffine (std::shared_ptr< LinearExpr > expr, double coeff, double constant)
 
static std::shared_ptr< LinearExprAffineCst (double value, double coeff, double constant)
 
static std::shared_ptr< LinearExprConstant (double value)
 

Detailed Description

A class to hold a variable index.

Definition at line 274 of file model_builder_helper.h.

Constructor & Destructor Documentation

◆ Variable() [1/5]

operations_research::mb::Variable::Variable ( ModelBuilderHelper * helper,
int index )

Definition at line 1169 of file model_builder_helper.cc.

◆ Variable() [2/5]

operations_research::mb::Variable::Variable ( ModelBuilderHelper * helper,
double lb,
double ub,
bool is_integral )

Definition at line 1172 of file model_builder_helper.cc.

◆ Variable() [3/5]

operations_research::mb::Variable::Variable ( ModelBuilderHelper * helper,
double lb,
double ub,
bool is_integral,
const std::string & name )

Definition at line 1181 of file model_builder_helper.cc.

◆ Variable() [4/5]

operations_research::mb::Variable::Variable ( ModelBuilderHelper * helper,
int64_t lb,
int64_t ub,
bool is_integral )

Definition at line 1191 of file model_builder_helper.cc.

◆ Variable() [5/5]

operations_research::mb::Variable::Variable ( ModelBuilderHelper * helper,
int64_t lb,
int64_t ub,
bool is_integral,
const std::string & name )

Definition at line 1200 of file model_builder_helper.cc.

◆ ~Variable()

operations_research::mb::Variable::~Variable ( )
inlineoverride

Definition at line 284 of file model_builder_helper.h.

Member Function Documentation

◆ DebugString()

std::string operations_research::mb::Variable::DebugString ( ) const
overridevirtual

Implements operations_research::mb::LinearExpr.

Definition at line 1218 of file model_builder_helper.cc.

◆ helper()

ModelBuilderHelper * operations_research::mb::Variable::helper ( ) const
inline

Definition at line 286 of file model_builder_helper.h.

◆ index()

int operations_research::mb::Variable::index ( ) const
inline

Definition at line 287 of file model_builder_helper.h.

◆ is_integral()

bool operations_research::mb::Variable::is_integral ( ) const

Definition at line 1248 of file model_builder_helper.cc.

◆ lower_bounds()

double operations_research::mb::Variable::lower_bounds ( ) const

Definition at line 1236 of file model_builder_helper.cc.

◆ name()

std::string operations_research::mb::Variable::name ( ) const

Definition at line 1226 of file model_builder_helper.cc.

◆ objective_coefficient()

double operations_research::mb::Variable::objective_coefficient ( ) const

Definition at line 1254 of file model_builder_helper.cc.

◆ operator<()

bool operations_research::mb::Variable::operator< ( const Variable & other) const
inline

Definition at line 309 of file model_builder_helper.h.

◆ SetIsIntegral()

void operations_research::mb::Variable::SetIsIntegral ( bool is_integral)

Definition at line 1250 of file model_builder_helper.cc.

◆ SetLowerBound()

void operations_research::mb::Variable::SetLowerBound ( double lb)

Definition at line 1238 of file model_builder_helper.cc.

◆ SetName()

void operations_research::mb::Variable::SetName ( const std::string & name)

Definition at line 1232 of file model_builder_helper.cc.

◆ SetObjectiveCoefficient()

void operations_research::mb::Variable::SetObjectiveCoefficient ( double coeff)

Definition at line 1258 of file model_builder_helper.cc.

◆ SetUpperBound()

void operations_research::mb::Variable::SetUpperBound ( double ub)

Definition at line 1244 of file model_builder_helper.cc.

◆ ToString()

std::string operations_research::mb::Variable::ToString ( ) const
overridevirtual

Implements operations_research::mb::LinearExpr.

Definition at line 1210 of file model_builder_helper.cc.

◆ upper_bound()

double operations_research::mb::Variable::upper_bound ( ) const

Definition at line 1242 of file model_builder_helper.cc.

◆ Visit()

void operations_research::mb::Variable::Visit ( ExprVisitor & lin,
double c )
inlineoverridevirtual

Implements operations_research::mb::LinearExpr.

Definition at line 299 of file model_builder_helper.h.

Member Data Documentation

◆ helper_

ModelBuilderHelper* operations_research::mb::Variable::helper_
protected

Definition at line 312 of file model_builder_helper.h.

◆ index_

int operations_research::mb::Variable::index_
protected

Definition at line 313 of file model_builder_helper.h.


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