Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Google.OrTools.Sat.IntVar Class Reference

Holds a integer variable with a discrete domain. More...

Inheritance diagram for Google.OrTools.Sat.IntVar:
Google.OrTools.Sat.LinearExpr Google.OrTools.Sat.BoolVar

Public Member Functions

 IntVar (CpModelProto model, Domain domain, string name)
 
 IntVar (CpModelProto model, long lb, long ub, string name)
 
 IntVar (CpModelProto model, int index)
 
int GetIndex ()
 
override string ToString ()
 
string Name ()
 

Protected Attributes

readonly int index_
 
IntegerVariableProto var_
 

Properties

int Index [get]
 
IntegerVariableProto Proto [get, set]
 
Domain Domain [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Google.OrTools.Sat.LinearExpr
static LinearExpr Sum (IEnumerable< LinearExpr > exprs)
 Creates Sum(exprs).
 
static LinearExpr Sum (IEnumerable< ILiteral > literals)
 Creates Sum(literals).
 
static LinearExpr Sum (IEnumerable< BoolVar > vars)
 Creates Sum(vars).
 
static LinearExpr WeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< int > coeffs)
 Creates Sum(exprs[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< long > coeffs)
 Creates Sum(exprs[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< ILiteral > literals, IEnumerable< int > coeffs)
 Creates Sum(literals[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< ILiteral > literals, IEnumerable< long > coeffs)
 Creates Sum(literals[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< BoolVar > vars, IEnumerable< int > coeffs)
 Creates Sum(vars[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< BoolVar > vars, IEnumerable< long > coeffs)
 Creates Sum(vars[i] * coeffs[i]).
 
static LinearExpr Term (LinearExpr expr, long coeff)
 Creates expr * coeff.
 
static LinearExpr Term (ILiteral literal, long coeff)
 Creates literal * coeff.
 
static LinearExpr Term (BoolVar var, long coeff)
 Creates var * coeff.
 
static LinearExpr Affine (LinearExpr expr, long coeff, long offset)
 Creates expr * coeff + offset.
 
static LinearExpr Affine (ILiteral literal, long coeff, long offset)
 Creates literal * coeff + offset.
 
static LinearExpr Affine (BoolVar var, long coeff, long offset)
 Creates var * coeff + offset.
 
static LinearExpr Constant (long 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, long v)
 
static LinearExpr operator+ (long v, LinearExpr a)
 
static LinearExpr operator- (LinearExpr a, LinearExpr b)
 
static LinearExpr operator- (LinearExpr a, long v)
 
static LinearExpr operator- (long v, LinearExpr a)
 
static LinearExpr operator* (LinearExpr a, long v)
 
static LinearExpr operator* (long 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, long v)
 
static BoundedLinearExpression operator!= (LinearExpr a, long v)
 
static BoundedLinearExpression operator>= (LinearExpr a, long v)
 
static BoundedLinearExpression operator>= (long v, LinearExpr a)
 
static BoundedLinearExpression operator> (LinearExpr a, long v)
 
static BoundedLinearExpression operator> (long v, LinearExpr a)
 
static BoundedLinearExpression operator<= (LinearExpr a, long v)
 
static BoundedLinearExpression operator<= (long v, LinearExpr a)
 
static BoundedLinearExpression operator< (LinearExpr a, long v)
 
static BoundedLinearExpression operator< (long v, LinearExpr a)
 
static BoundedLinearExpression operator>= (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator> (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator<= (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator< (LinearExpr a, LinearExpr b)
 
- Static Package Functions inherited from Google.OrTools.Sat.LinearExpr

Detailed Description

Holds a integer variable with a discrete domain.

This class must be constructed from the CpModel class.

Definition at line 719 of file IntegerExpressions.cs.

Constructor & Destructor Documentation

◆ IntVar() [1/3]

Google.OrTools.Sat.IntVar.IntVar ( CpModelProto model,
Domain domain,
string name )
inline

Definition at line 721 of file IntegerExpressions.cs.

◆ IntVar() [2/3]

Google.OrTools.Sat.IntVar.IntVar ( CpModelProto model,
long lb,
long ub,
string name )
inline

Definition at line 730 of file IntegerExpressions.cs.

◆ IntVar() [3/3]

Google.OrTools.Sat.IntVar.IntVar ( CpModelProto model,
int index )
inline

Definition at line 741 of file IntegerExpressions.cs.

Member Function Documentation

◆ GetIndex()

int Google.OrTools.Sat.IntVar.GetIndex ( )
inline

Returns the index of the variable in the underlying CpModelProto.

Definition at line 748 of file IntegerExpressions.cs.

◆ Name()

string Google.OrTools.Sat.IntVar.Name ( )
inline

Returns the name of the variable given upon creation.

Definition at line 786 of file IntegerExpressions.cs.

◆ ToString()

override string Google.OrTools.Sat.IntVar.ToString ( )
inline

Definition at line 780 of file IntegerExpressions.cs.

Member Data Documentation

◆ index_

readonly int Google.OrTools.Sat.IntVar.index_
protected

Definition at line 791 of file IntegerExpressions.cs.

◆ var_

IntegerVariableProto Google.OrTools.Sat.IntVar.var_
protected

Definition at line 792 of file IntegerExpressions.cs.

Property Documentation

◆ Domain

Domain Google.OrTools.Sat.IntVar.Domain
get

Returns the domain of the variable.

Definition at line 773 of file IntegerExpressions.cs.

◆ Index

int Google.OrTools.Sat.IntVar.Index
get

Returns the index of the variable in the underlying CpModelProto.

Definition at line 754 of file IntegerExpressions.cs.

◆ Proto

IntegerVariableProto Google.OrTools.Sat.IntVar.Proto
getset

The underlying IntegerVariableProto.

Definition at line 762 of file IntegerExpressions.cs.


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