Java Reference

Java Reference

LinearExpr

Detailed Description

A linear expression interface that can be parsed.

Definition at line 17 of file LinearExpr.java.

Public Member Functions

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...
 

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

◆ getCoefficient()

long getCoefficient ( int  index)

Returns the ith coefficient.

Implemented in IntVar, ScalProd, and SumOfVariables.

◆ getVariable()

IntVar getVariable ( int  index)

Returns the ith variable.

Implemented in IntVar, ScalProd, and SumOfVariables.

◆ numElements()

int numElements ( )

Returns the number of elements in the interface.

Implemented in IntVar, ScalProd, and SumOfVariables.

◆ scalProd() [1/2]

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

Creates a scalar product.

Definition at line 38 of file LinearExpr.java.

◆ scalProd() [2/2]

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

Creates a scalar product.

Definition at line 33 of file LinearExpr.java.

◆ sum()

static LinearExpr sum ( IntVar[]  variables)
inlinestatic

Creates a sum expression.

Definition at line 28 of file LinearExpr.java.

◆ term()

static LinearExpr term ( IntVar  variable,
long  coefficient 
)
inlinestatic

Creates a linear term (var * coefficient).

Definition at line 47 of file LinearExpr.java.


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