Google OR-Tools v9.14
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...

Detailed Description

A class to hold a variable index.

Definition at line 228 of file model_builder_helper.h.

#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)
virtual std::shared_ptr< LinearExprAddFloat (double cst)
std::shared_ptr< LinearExprSub (std::shared_ptr< LinearExpr > expr)
virtual std::shared_ptr< LinearExprSubFloat (double cst)
virtual std::shared_ptr< LinearExprRSubFloat (double cst)
virtual std::shared_ptr< LinearExprMulFloat (double cst)
virtual 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)

Constructor & Destructor Documentation

◆ Variable() [1/5]

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

Definition at line 1230 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 1233 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 1242 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 1252 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 1261 of file model_builder_helper.cc.

◆ ~Variable()

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

Definition at line 238 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 1279 of file model_builder_helper.cc.

◆ helper()

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

Definition at line 240 of file model_builder_helper.h.

◆ index()

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

Definition at line 241 of file model_builder_helper.h.

◆ is_integral()

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

Definition at line 1309 of file model_builder_helper.cc.

◆ lower_bounds()

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

Definition at line 1297 of file model_builder_helper.cc.

◆ name()

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

Definition at line 1287 of file model_builder_helper.cc.

◆ objective_coefficient()

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

Definition at line 1315 of file model_builder_helper.cc.

◆ operator<()

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

Definition at line 263 of file model_builder_helper.h.

◆ SetIsIntegral()

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

Definition at line 1311 of file model_builder_helper.cc.

◆ SetLowerBound()

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

Definition at line 1299 of file model_builder_helper.cc.

◆ SetName()

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

Definition at line 1293 of file model_builder_helper.cc.

◆ SetObjectiveCoefficient()

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

Definition at line 1319 of file model_builder_helper.cc.

◆ SetUpperBound()

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

Definition at line 1305 of file model_builder_helper.cc.

◆ ToString()

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

Implements operations_research::mb::LinearExpr.

Definition at line 1271 of file model_builder_helper.cc.

◆ upper_bound()

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

Definition at line 1303 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 253 of file model_builder_helper.h.

Member Data Documentation

◆ helper_

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

Definition at line 266 of file model_builder_helper.h.

◆ index_

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

Definition at line 267 of file model_builder_helper.h.


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