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

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

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

Definition at line 17 of file LinearExpr.java.

Member Function Documentation

◆ affine() [1/2]

static LinearExpr com.google.ortools.modelbuilder.LinearExpr.affine ( LinearArgument expr,
double coeff,
double offset )
static

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

Definition at line 46 of file LinearExpr.java.

◆ affine() [2/2]

static LinearExpr com.google.ortools.modelbuilder.LinearExpr.affine ( LinearArgument expr,
double coeff,
double offset )
static

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

Definition at line 46 of file LinearExpr.java.

◆ constant() [1/2]

static LinearExpr com.google.ortools.modelbuilder.LinearExpr.constant ( double value)
static

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

Definition at line 36 of file LinearExpr.java.

◆ constant() [2/2]

static LinearExpr com.google.ortools.modelbuilder.LinearExpr.constant ( double value)
static

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

Definition at line 36 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.modelbuilder.LinearExpr.newBuilder ( )
static

Returns a builder

Definition at line 31 of file LinearExpr.java.

◆ newBuilder() [2/2]

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

Returns a builder

Definition at line 31 of file LinearExpr.java.

◆ numElements() [1/2]

◆ numElements() [2/2]

◆ sum() [1/2]

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

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

Definition at line 51 of file LinearExpr.java.

◆ sum() [2/2]

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

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

Definition at line 51 of file LinearExpr.java.

◆ term() [1/2]

static LinearExpr com.google.ortools.modelbuilder.LinearExpr.term ( LinearArgument expr,
double coeff )
static

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

Definition at line 41 of file LinearExpr.java.

◆ term() [2/2]

static LinearExpr com.google.ortools.modelbuilder.LinearExpr.term ( LinearArgument expr,
double coeff )
static

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

Definition at line 41 of file LinearExpr.java.

◆ weightedSum() [1/2]

static LinearExpr com.google.ortools.modelbuilder.LinearExpr.weightedSum ( LinearArgument[] exprs,
double[] coeffs )
static

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

Definition at line 56 of file LinearExpr.java.

◆ weightedSum() [2/2]

static LinearExpr com.google.ortools.modelbuilder.LinearExpr.weightedSum ( LinearArgument[] exprs,
double[] coeffs )
static

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

Definition at line 56 of file LinearExpr.java.


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