|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.singularsys.aa.SimpleExpr
com.singularsys.aa.polynomial.PolynomialExpr
public class PolynomialExpr
This class represents a polynomial expression consisting of any number of terms of type
PolynomialTerm.
Field Summary |
---|
Fields inherited from class com.singularsys.aa.SimpleExpr |
---|
variables |
Constructor Summary | |
---|---|
PolynomialExpr(java.util.Vector variables_in)
Creates a new instance of Polynomial |
Method Summary | |
---|---|
void |
addToExponent(java.lang.String name,
double value)
Adds |
java.util.Vector |
getTerms()
Returns the Vector of PolynomialTerm objects. |
java.lang.Object |
getValue(java.util.Hashtable varValues)
Returns the value of the expression given the variable values in |
void |
makeNewTerm()
Starts a new PolynomialTerm to which the calls to multiplyCoefficientWith() and addToExponent() will be applied. |
void |
multiplyCoefficientWith(double value)
Multiplies the coefficient of the current term with |
void |
simplify()
Simplifies this polynomial with the PolySimplifier class. |
java.lang.String |
toString()
|
Methods inherited from class com.singularsys.aa.SimpleExpr |
---|
getValue, getVariables |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PolynomialExpr(java.util.Vector variables_in)
Method Detail |
---|
public void makeNewTerm()
According to the constructor of PolynomialTerm, the coefficient is set to 1, and all exponents to 0.
public void multiplyCoefficientWith(double value)
value.
makeNewTerm()must be called before using this method.
value
- the value to multiply the coefficient with.public void addToExponent(java.lang.String name, double value)
valueto the exponents of the variable
namefor the current term.
makeNewTerm()must be called before using this method.
name
- the variable name as the base for the exponent.value
- the value to be added to the exponent.public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Vector getTerms()
public void simplify()
public java.lang.Object getValue(java.util.Hashtable varValues)
varValues.
getValue
in interface Expression
getValue
in class SimpleExpr
varValues
- A hastable containing the variable names as keys, and the
values as objects.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |