Java Reference

Java Reference

IntVar

Detailed Description

An integer variable.

Definition at line 21 of file java/com/google/ortools/sat/IntVar.java.

Public Member Functions

String toString ()
 
String getName ()
 Returns the name of the variable given upon creation. More...
 
int getIndex ()
 Internal, returns the index of the variable in the underlying CpModelProto. More...
 
IntegerVariableProto.Builder getBuilder ()
 Returns the variable protobuf builder. More...
 
int numElements ()
 Returns the number of elements in the interface. More...
 
IntVar getVariable (int index)
 Returns the ith variable. More...
 
long getCoefficient (int index)
 Returns the ith coefficient. More...
 
String getShortString ()
 Returns a short string describing the variable. More...
 
String displayBounds ()
 Returns the domain as a string without the enclosing []. More...
 
Literal not ()
 Returns the negation of a boolean variable. More...
 
Domain getDomain ()
 Returns the domain of the variable. More...
 

Static Public Member Functions

static LinearExpr sum (IntVar[] variables)
 Creates a sum expression. More...
 
static LinearExpr scalProd (IntVar[] variables, long[] coefficients)
 Creates a scalar product. More...
 
static LinearExpr scalProd (IntVar[] variables, int[] coefficients)
 Creates a scalar product. More...
 
static LinearExpr term (IntVar variable, long coefficient)
 Creates a linear term (var * coefficient). More...
 

Member Function Documentation

◆ displayBounds()

String displayBounds ( )
inline

Returns the domain as a string without the enclosing [].

Definition at line 87 of file java/com/google/ortools/sat/IntVar.java.

◆ getBuilder()

IntegerVariableProto.Builder getBuilder ( )
inline

Returns the variable protobuf builder.

Definition at line 50 of file java/com/google/ortools/sat/IntVar.java.

◆ getCoefficient()

long getCoefficient ( int  index)
inline

Returns the ith coefficient.

Implements LinearExpr.

Definition at line 67 of file java/com/google/ortools/sat/IntVar.java.

◆ getDomain()

Domain getDomain ( )
inline

Returns the domain of the variable.

Definition at line 112 of file java/com/google/ortools/sat/IntVar.java.

◆ getIndex()

int getIndex ( )
inline

Internal, returns the index of the variable in the underlying CpModelProto.

Implements Literal.

Definition at line 45 of file java/com/google/ortools/sat/IntVar.java.

◆ getName()

String getName ( )
inline

Returns the name of the variable given upon creation.

Definition at line 39 of file java/com/google/ortools/sat/IntVar.java.

◆ getShortString()

String getShortString ( )
inline

Returns a short string describing the variable.

Implements Literal.

Definition at line 74 of file java/com/google/ortools/sat/IntVar.java.

◆ getVariable()

IntVar getVariable ( int  index)
inline

Returns the ith variable.

Implements LinearExpr.

Definition at line 61 of file java/com/google/ortools/sat/IntVar.java.

◆ not()

Literal not ( )
inline

Returns the negation of a boolean variable.

Implements Literal.

Definition at line 104 of file java/com/google/ortools/sat/IntVar.java.

◆ numElements()

int numElements ( )
inline

Returns the number of elements in the interface.

Implements LinearExpr.

Definition at line 56 of file java/com/google/ortools/sat/IntVar.java.

◆ scalProd() [1/2]

static LinearExpr scalProd ( IntVar[]  variables,
int[]  coefficients 
)
inlinestaticinherited

Creates a scalar product.

Definition at line 38 of file LinearExpr.java.

◆ scalProd() [2/2]

static LinearExpr scalProd ( IntVar[]  variables,
long[]  coefficients 
)
inlinestaticinherited

Creates a scalar product.

Definition at line 33 of file LinearExpr.java.

◆ sum()

static LinearExpr sum ( IntVar[]  variables)
inlinestaticinherited

Creates a sum expression.

Definition at line 28 of file LinearExpr.java.

◆ term()

static LinearExpr term ( IntVar  variable,
long  coefficient 
)
inlinestaticinherited

Creates a linear term (var * coefficient).

Definition at line 47 of file LinearExpr.java.

◆ toString()

String toString ( )
inline

Definition at line 34 of file java/com/google/ortools/sat/IntVar.java.


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