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

Public Member Functions

 WeightedSumExpression (int[] variablesIndices, double[] coefficients, double offset)
 
LinearExpr build ()
 
int numElements ()
 
int getVariableIndex (int index)
 
double getCoefficient (int index)
 
double getOffset ()
 
 WeightedSumExpression (int[] variablesIndices, double[] coefficients, double offset)
 
LinearExpr build ()
 
int numElements ()
 
int getVariableIndex (int index)
 
double getCoefficient (int index)
 
double getOffset ()
 
- Public Member Functions inherited from com.google.ortools.modelbuilder.LinearExpr
- Public Member Functions inherited from com.google.ortools.modelbuilder.LinearArgument

Additional Inherited Members

- Static Public Member Functions inherited from com.google.ortools.modelbuilder.LinearExpr
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 specialized linear expression: sum(ai * xi) + b.

Definition at line 17 of file WeightedSumExpression.java.

Constructor & Destructor Documentation

◆ WeightedSumExpression() [1/2]

com.google.ortools.modelbuilder.WeightedSumExpression.WeightedSumExpression ( int[] variablesIndices,
double[] coefficients,
double offset )

Definition at line 22 of file WeightedSumExpression.java.

◆ WeightedSumExpression() [2/2]

com.google.ortools.modelbuilder.WeightedSumExpression.WeightedSumExpression ( int[] variablesIndices,
double[] coefficients,
double offset )

Definition at line 22 of file WeightedSumExpression.java.

Member Function Documentation

◆ build() [1/2]

LinearExpr com.google.ortools.modelbuilder.WeightedSumExpression.build ( )

Builds a linear expression.

Implements com.google.ortools.modelbuilder.LinearArgument.

Definition at line 29 of file WeightedSumExpression.java.

◆ build() [2/2]

LinearExpr com.google.ortools.modelbuilder.WeightedSumExpression.build ( )

Builds a linear expression.

Implements com.google.ortools.modelbuilder.LinearArgument.

Definition at line 29 of file WeightedSumExpression.java.

◆ getCoefficient() [1/2]

double com.google.ortools.modelbuilder.WeightedSumExpression.getCoefficient ( int index)

Returns the ith coefficient.

Implements com.google.ortools.modelbuilder.LinearExpr.

Definition at line 47 of file WeightedSumExpression.java.

◆ getCoefficient() [2/2]

double com.google.ortools.modelbuilder.WeightedSumExpression.getCoefficient ( int index)

Returns the ith coefficient.

Implements com.google.ortools.modelbuilder.LinearExpr.

Definition at line 47 of file WeightedSumExpression.java.

◆ getOffset() [1/2]

double com.google.ortools.modelbuilder.WeightedSumExpression.getOffset ( )

Returns the constant part of the expression.

Implements com.google.ortools.modelbuilder.LinearExpr.

Definition at line 55 of file WeightedSumExpression.java.

◆ getOffset() [2/2]

double com.google.ortools.modelbuilder.WeightedSumExpression.getOffset ( )

Returns the constant part of the expression.

Implements com.google.ortools.modelbuilder.LinearExpr.

Definition at line 55 of file WeightedSumExpression.java.

◆ getVariableIndex() [1/2]

int com.google.ortools.modelbuilder.WeightedSumExpression.getVariableIndex ( int index)

Returns the index of the ith variable.

Implements com.google.ortools.modelbuilder.LinearExpr.

Definition at line 39 of file WeightedSumExpression.java.

◆ getVariableIndex() [2/2]

int com.google.ortools.modelbuilder.WeightedSumExpression.getVariableIndex ( int index)

Returns the index of the ith variable.

Implements com.google.ortools.modelbuilder.LinearExpr.

Definition at line 39 of file WeightedSumExpression.java.

◆ numElements() [1/2]

int com.google.ortools.modelbuilder.WeightedSumExpression.numElements ( )

Returns the number of terms (excluding the constant one) in this expression.

Implements com.google.ortools.modelbuilder.LinearExpr.

Definition at line 34 of file WeightedSumExpression.java.

◆ numElements() [2/2]

int com.google.ortools.modelbuilder.WeightedSumExpression.numElements ( )

Returns the number of terms (excluding the constant one) in this expression.

Implements com.google.ortools.modelbuilder.LinearExpr.

Definition at line 34 of file WeightedSumExpression.java.


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