public class LinearExpression
extends java.lang.Object
Constructor and Description |
---|
LinearExpression() |
Modifier and Type | Method and Description |
---|---|
void |
addTerm(double coefficient,
Variable v)
Adds the given coefficient*variable term to this linear expression.
|
Term |
getTerm(Variable variable) |
java.util.List<Term> |
getTerms() |
java.util.List<Variable> |
getVariables() |
void |
invert()
Invert all the coefficients in this linear expression.
|
java.lang.String |
toString() |
public void addTerm(double coefficient, Variable v)
coefficient
- any numbervariableName
- the name of the variable to which the coefficient is applied.
It must begin with a letterpublic java.lang.String toString()
toString
in class java.lang.Object
public void invert()
public java.util.List<Term> getTerms()
public java.util.List<Variable> getVariables()