public final class ConstantExpression extends java.lang.Object implements LinearExpr
| Constructor and Description |
|---|
ConstantExpression(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.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaffine, constant, newBuilder, rebuildFromLinearExpressionProto, sum, term, weightedSumpublic LinearExpr build()
LinearArgumentbuild in interface LinearArgumentpublic int numElements()
LinearExprnumElements in interface LinearExprpublic int getVariableIndex(int index)
LinearExprgetVariableIndex in interface LinearExprpublic long getCoefficient(int index)
LinearExprgetCoefficient in interface LinearExprpublic long getOffset()
LinearExprgetOffset in interface LinearExprpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2024. All rights reserved.