public final class WeightedSumExpression extends java.lang.Object implements LinearExpr
Constructor and Description |
---|
WeightedSumExpression(int[] variablesIndices,
long[] coefficients,
long offset) |
Modifier and Type | Method and Description |
---|---|
LinearExpr |
build()
Builds a linear expression.
|
long |
getCoefficient(int index)
Returns the ith coefficient.
|
long |
getOffset()
Returns the constant part of the expression.
|
int |
getVariableIndex(int index)
Returns the index of the ith variable.
|
int |
numElements()
Returns the number of terms (excluding the constant one) in this expression.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
affine, constant, newBuilder, rebuildFromLinearExpressionProto, sum, term, weightedSum
public WeightedSumExpression(int[] variablesIndices, long[] coefficients, long offset)
public LinearExpr build()
LinearArgument
build
in interface LinearArgument
public int numElements()
LinearExpr
numElements
in interface LinearExpr
public int getVariableIndex(int index)
LinearExpr
getVariableIndex
in interface LinearExpr
public long getCoefficient(int index)
LinearExpr
getCoefficient
in interface LinearExpr
public long getOffset()
LinearExpr
getOffset
in interface LinearExpr
Copyright © 2025. All rights reserved.