Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.sat.LinearExpr Interface Reference
Inheritance diagram for com.google.ortools.sat.LinearExpr:
com.google.ortools.sat.LinearArgument com.google.ortools.sat.LinearArgument com.google.ortools.sat.AffineExpression com.google.ortools.sat.AffineExpression com.google.ortools.sat.ConstantExpression com.google.ortools.sat.ConstantExpression com.google.ortools.sat.WeightedSumExpression com.google.ortools.sat.WeightedSumExpression

Public Member Functions

int numElements ()
 
int getVariableIndex (int index)
 
long getCoefficient (int index)
 
long getOffset ()
 
int numElements ()
 
int getVariableIndex (int index)
 
long getCoefficient (int index)
 
long getOffset ()
 
- Public Member Functions inherited from com.google.ortools.sat.LinearArgument
LinearExpr build ()
 
LinearExpr build ()
 

Static Public Member Functions

static LinearExprBuilder newBuilder ()
 
static LinearExpr constant (long value)
 
static LinearExpr term (LinearArgument expr, long coeff)
 
static LinearExpr affine (LinearArgument expr, long coeff, long offset)
 
static LinearExpr sum (LinearArgument[] exprs)
 
static LinearExpr weightedSum (LinearArgument[] exprs, long[] coeffs)
 
static LinearExpr rebuildFromLinearExpressionProto (LinearExpressionProto proto)
 
static LinearExprBuilder newBuilder ()
 
static LinearExpr constant (long value)
 
static LinearExpr term (LinearArgument expr, long coeff)
 
static LinearExpr affine (LinearArgument expr, long coeff, long offset)
 
static LinearExpr sum (LinearArgument[] exprs)
 
static LinearExpr weightedSum (LinearArgument[] exprs, long[] coeffs)
 
static LinearExpr rebuildFromLinearExpressionProto (LinearExpressionProto proto)
 

Detailed Description

A linear expression (sum (ai * xi) + b). It specifies methods to help parsing the expression.

Definition at line 19 of file LinearExpr.java.

Member Function Documentation

◆ affine() [1/2]

static LinearExpr com.google.ortools.sat.LinearExpr.affine ( LinearArgument expr,
long coeff,
long offset )
static

Shortcut for newBuilder().addTerm(expr, coeff).add(offset).build()

Definition at line 48 of file LinearExpr.java.

◆ affine() [2/2]

static LinearExpr com.google.ortools.sat.LinearExpr.affine ( LinearArgument expr,
long coeff,
long offset )
static

Shortcut for newBuilder().addTerm(expr, coeff).add(offset).build()

Definition at line 48 of file LinearExpr.java.

◆ constant() [1/2]

static LinearExpr com.google.ortools.sat.LinearExpr.constant ( long value)
static

Shortcut for newBuilder().add(value).build()

Definition at line 38 of file LinearExpr.java.

◆ constant() [2/2]

static LinearExpr com.google.ortools.sat.LinearExpr.constant ( long value)
static

Shortcut for newBuilder().add(value).build()

Definition at line 38 of file LinearExpr.java.

◆ getCoefficient() [1/2]

◆ getCoefficient() [2/2]

◆ getOffset() [1/2]

◆ getOffset() [2/2]

◆ getVariableIndex() [1/2]

◆ getVariableIndex() [2/2]

◆ newBuilder() [1/2]

static LinearExprBuilder com.google.ortools.sat.LinearExpr.newBuilder ( )
static

Returns a builder

Definition at line 33 of file LinearExpr.java.

◆ newBuilder() [2/2]

static LinearExprBuilder com.google.ortools.sat.LinearExpr.newBuilder ( )
static

Returns a builder

Definition at line 33 of file LinearExpr.java.

◆ numElements() [1/2]

◆ numElements() [2/2]

◆ rebuildFromLinearExpressionProto() [1/2]

static LinearExpr com.google.ortools.sat.LinearExpr.rebuildFromLinearExpressionProto ( LinearExpressionProto proto)
static

Definition at line 62 of file LinearExpr.java.

◆ rebuildFromLinearExpressionProto() [2/2]

static LinearExpr com.google.ortools.sat.LinearExpr.rebuildFromLinearExpressionProto ( LinearExpressionProto proto)
static

Definition at line 62 of file LinearExpr.java.

◆ sum() [1/2]

static LinearExpr com.google.ortools.sat.LinearExpr.sum ( LinearArgument[] exprs)
static

Shortcut for newBuilder().addSum(exprs).build()

Definition at line 53 of file LinearExpr.java.

◆ sum() [2/2]

static LinearExpr com.google.ortools.sat.LinearExpr.sum ( LinearArgument[] exprs)
static

Shortcut for newBuilder().addSum(exprs).build()

Definition at line 53 of file LinearExpr.java.

◆ term() [1/2]

static LinearExpr com.google.ortools.sat.LinearExpr.term ( LinearArgument expr,
long coeff )
static

Shortcut for newBuilder().addTerm(expr, coeff).build()

Definition at line 43 of file LinearExpr.java.

◆ term() [2/2]

static LinearExpr com.google.ortools.sat.LinearExpr.term ( LinearArgument expr,
long coeff )
static

Shortcut for newBuilder().addTerm(expr, coeff).build()

Definition at line 43 of file LinearExpr.java.

◆ weightedSum() [1/2]

static LinearExpr com.google.ortools.sat.LinearExpr.weightedSum ( LinearArgument[] exprs,
long[] coeffs )
static

Shortcut for newBuilder().addWeightedSum(exprs, coeffs).build()

Definition at line 58 of file LinearExpr.java.

◆ weightedSum() [2/2]

static LinearExpr com.google.ortools.sat.LinearExpr.weightedSum ( LinearArgument[] exprs,
long[] coeffs )
static

Shortcut for newBuilder().addWeightedSum(exprs, coeffs).build()

Definition at line 58 of file LinearExpr.java.


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