|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
V
- the variable type.public interface Polynomial<V>
This interface is used to represent polynomials.
A polynomial is a type of mathematical expression. It is the sum of a numerical constant and a set of terms. Each term contains a numerical coefficient and at least one variable. Each variable in a term can be raised to a non-negative whole number power. These basic facts about polynomials have been captured in this interface.
Nested Class Summary | |
---|---|
static interface |
Polynomial.Term<V>
This interface is used to represent the terms of a polynomial. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Indicates if the provided object is equal to this polynomial. |
double |
getConstant()
Returns the numerical constant of this polynomial. |
Polynomial.Term<V>[] |
getTermArray()
Returns an array containing all of the terms of this polynomial. |
int |
hashCode()
Returns a content-based hash code for this polynomial. |
Polynomial<V> |
plugInNumbers(java.util.Map<?,java.lang.Double> variableValues)
Plugs in the provided numerical values to produce a new polynomial. |
int |
terms()
Returns the number of terms contained in this polynomial. |
java.lang.String |
toString()
Returns an appropriate string representation of this polynomial. |
Methods inherited from interface sbrt.kernel.math.MathExpr |
---|
getVariables, hasAllVariables, hasVariable, hasVariables, variables |
Method Detail |
---|
Polynomial<V> plugInNumbers(java.util.Map<?,java.lang.Double> variableValues)
If some of the keys in the provided map are not variables in this expression, their provided value is simply ignored. If a value is provided for each variable in this polynomial, the resulting polynomial will not contain any terms of its own, only a constant.
plugInNumbers
in interface MathExpr<V>
variableValues
- objects mapped to numerical values.
double getConstant()
getConstant
in interface MathExpr<V>
Polynomial.Term<V>[] getTermArray()
int terms()
int hashCode()
hashCode
in interface MathExpr<V>
hashCode
in class java.lang.Object
boolean equals(java.lang.Object obj)
For two polynomials to be equal, they must contain the same numerical constant and terms.
equals
in interface MathExpr<V>
equals
in class java.lang.Object
obj
- the object to be tested for equality with
this mathematical expression.
true
if this polynomial is equal to the provided object;
false
otherwise.Polynomial.Term.equals(Object)
java.lang.String toString()
toString
in interface MathExpr<V>
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |