Java Reference

Java Reference

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...
 
long getOffset ()
 Returns the constant part of the expression. 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 booleanSum (Literal[] literals)
 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 booleanScalProd (Literal[] literals, long[] coefficients)
 Creates a scalar product. More...
 
static LinearExpr booleanScalProd (Literal[] literals, int[] coefficients)
 Creates a scalar product. More...
 
static LinearExpr term (IntVar variable, long coefficient)
 Creates a linear term (var * coefficient). More...
 

Member Function Documentation

◆ booleanScalProd() [1/2]

static LinearExpr booleanScalProd ( Literal[]  literals,
int[]  coefficients 
)
staticinherited

Creates a scalar product.

Definition at line 70 of file LinearExpr.java.

◆ booleanScalProd() [2/2]

static LinearExpr booleanScalProd ( Literal[]  literals,
long[]  coefficients 
)
staticinherited

Creates a scalar product.

Definition at line 62 of file LinearExpr.java.

◆ booleanSum()

static LinearExpr booleanSum ( Literal[]  literals)
staticinherited

Creates a sum expression.

Definition at line 36 of file LinearExpr.java.

◆ displayBounds()

String displayBounds ( )

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

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

◆ getBuilder()

IntegerVariableProto.Builder getBuilder ( )

Returns the variable protobuf builder.

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

◆ getCoefficient()

long getCoefficient ( int  index)

Returns the ith coefficient.

Implements LinearExpr.

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

◆ getDomain()

Domain getDomain ( )

Returns the domain of the variable.

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

◆ getIndex()

int getIndex ( )

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 ( )

Returns the name of the variable given upon creation.

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

◆ getOffset()

long getOffset ( )

Returns the constant part of the expression.

Implements LinearExpr.

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

◆ getShortString()

String getShortString ( )

Returns a short string describing the variable.

Implements Literal.

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

◆ getVariable()

IntVar getVariable ( int  index)

Returns the ith variable.

Implements LinearExpr.

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

◆ not()

Literal not ( )

Returns the negation of a boolean variable.

Implements Literal.

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

◆ numElements()

int numElements ( )

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 
)
staticinherited

Creates a scalar product.

Definition at line 50 of file LinearExpr.java.

◆ scalProd() [2/2]

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

Creates a scalar product.

Definition at line 42 of file LinearExpr.java.

◆ sum()

static LinearExpr sum ( IntVar[]  variables)
staticinherited

Creates a sum expression.

Definition at line 31 of file LinearExpr.java.

◆ term()

static LinearExpr term ( IntVar  variable,
long  coefficient 
)
staticinherited

Creates a linear term (var * coefficient).

Definition at line 83 of file LinearExpr.java.

◆ toString()

String toString ( )

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


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