Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Google.OrTools.ModelBuilder.Variable Class Reference

Holds a variable. More...

Inheritance diagram for Google.OrTools.ModelBuilder.Variable:
Google.OrTools.ModelBuilder.LinearExpr

Public Member Functions

 Variable (ModelBuilderHelper helper, double lb, double ub, bool isIntegral, string name)
 
 Variable (ModelBuilderHelper helper, int index)
 
override string ToString ()
 

Protected Attributes

readonly int index_
 
ModelBuilderHelper helper_
 

Properties

int Index [get]
 
ModelBuilderHelper Helper [get]
 
double LowerBound [get, set]
 
double UpperBound [get, set]
 
string Name [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Google.OrTools.ModelBuilder.LinearExpr
static LinearExpr Sum (IEnumerable< LinearExpr > exprs)
 Creates Sum(exprs).
 
static LinearExpr WeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< int > coeffs)
 Creates Sum(exprs[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< double > coeffs)
 Creates Sum(exprs[i] * coeffs[i]).
 
static LinearExpr Term (LinearExpr expr, double coeff)
 Creates expr * coeff.
 
static LinearExpr Affine (LinearExpr expr, double coeff, double offset)
 Creates expr * coeff + offset.
 
static LinearExpr Constant (double value)
 Creates a constant expression.
 
static LinearExprBuilder NewBuilder (int sizeHint=2)
 Creates a builder class for linear expression.
 
static LinearExpr operator+ (LinearExpr a, LinearExpr b)
 
static LinearExpr operator+ (LinearExpr a, double v)
 
static LinearExpr operator+ (double v, LinearExpr a)
 
static LinearExpr operator- (LinearExpr a, LinearExpr b)
 
static LinearExpr operator- (LinearExpr a, double v)
 
static LinearExpr operator- (double v, LinearExpr a)
 
static LinearExpr operator* (LinearExpr a, double v)
 
static LinearExpr operator* (double v, LinearExpr a)
 
static LinearExpr operator- (LinearExpr a)
 
static BoundedLinearExpression operator== (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator!= (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator== (LinearExpr a, double v)
 
static BoundedLinearExpression operator!= (LinearExpr a, double v)
 
static BoundedLinearExpression operator>= (LinearExpr a, double v)
 
static BoundedLinearExpression operator>= (double v, LinearExpr a)
 
static BoundedLinearExpression operator<= (LinearExpr a, double v)
 
static BoundedLinearExpression operator<= (double v, LinearExpr a)
 
static BoundedLinearExpression operator>= (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator<= (LinearExpr a, LinearExpr b)
 

Detailed Description

Holds a variable.

This class must be constructed from the CpModel class.

Definition at line 483 of file ModelBuilderExpr.cs.

Constructor & Destructor Documentation

◆ Variable() [1/2]

Google.OrTools.ModelBuilder.Variable.Variable ( ModelBuilderHelper helper,
double lb,
double ub,
bool isIntegral,
string name )
inline

Definition at line 485 of file ModelBuilderExpr.cs.

◆ Variable() [2/2]

Google.OrTools.ModelBuilder.Variable.Variable ( ModelBuilderHelper helper,
int index )
inline

Definition at line 498 of file ModelBuilderExpr.cs.

Member Function Documentation

◆ ToString()

override string Google.OrTools.ModelBuilder.Variable.ToString ( )
inline

Definition at line 541 of file ModelBuilderExpr.cs.

Member Data Documentation

◆ helper_

ModelBuilderHelper Google.OrTools.ModelBuilder.Variable.helper_
protected

Definition at line 556 of file ModelBuilderExpr.cs.

◆ index_

readonly int Google.OrTools.ModelBuilder.Variable.index_
protected

Definition at line 555 of file ModelBuilderExpr.cs.

Property Documentation

◆ Helper

ModelBuilderHelper Google.OrTools.ModelBuilder.Variable.Helper
get

The underlying VariableProto.

Definition at line 513 of file ModelBuilderExpr.cs.

◆ Index

int Google.OrTools.ModelBuilder.Variable.Index
get

Returns the index of the variable in the underlying ModelBuilderHelper.

Definition at line 505 of file ModelBuilderExpr.cs.

◆ LowerBound

double Google.OrTools.ModelBuilder.Variable.LowerBound
getset

Returns the domain of the variable.

Definition at line 521 of file ModelBuilderExpr.cs.

◆ Name

string Google.OrTools.ModelBuilder.Variable.Name
get

Returns the name of the variable given upon creation.

Definition at line 548 of file ModelBuilderExpr.cs.

◆ UpperBound

double Google.OrTools.ModelBuilder.Variable.UpperBound
getset

Definition at line 531 of file ModelBuilderExpr.cs.


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