|
JADE v6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dautelle.realtime.RealtimeObject
com.dautelle.math.functions.Function
com.dautelle.math.functions.Polynomial
This class represents a mathematical expression involving a sum of powers
in one or more variables
multiplied by
coefficients (such as x² + x·y + 3y²
).
Polynomials are also characterized by the type of variable they operate upon. For example:
Polynomial x = Polynomial.valueOf(Scalar.ONE, Variable.X);and
Polynomial x = Polynomial.valueOf(Complex.ONE, Variable.X);are two different polynomials, the first operates on
dimensionless
quantities,
whereas the second operates on
complex
numbers.
Nested Class Summary | |
static class |
Polynomial.Term
This class represents the term of a polynomial
such as x·y² . |
Nested classes inherited from class com.dautelle.math.functions.Function |
Function.Variable |
Nested classes inherited from class com.dautelle.realtime.RealtimeObject |
RealtimeObject.Factory |
Method Summary | |
java.lang.StringBuffer |
appendTo(java.lang.StringBuffer sb)
Appends the text representation of this function to the StringBuffer argument. |
Function |
compose(Function f)
Returns the composition of this function with the one specified. |
Function |
differentiate(Function.Variable v)
Returns the first derivative of this function with respect to the specified variable. |
boolean |
equals(java.lang.Object that)
Compares this polynomial against the specified object. |
Operable |
evaluate()
Evaluates this function by replacing its variables by their current (context-local) values. |
java.lang.Object |
export()
Exports this object out of the current pool context. |
Operable |
getCoefficient(Polynomial.Term term)
Returns the coefficient for the specified term. |
int |
getOrder(Function.Variable v)
Returns the order of this polynomial for the specified variable. |
java.util.Collection |
getTerms()
Returns the terms of this polynomial. |
java.util.Set |
getVariables()
Returns a set containing this function variables . |
int |
hashCode()
Returns the hash code for this polynomial. |
Function |
integrate(Function.Variable v)
Returns an integral of this function with respect to the specified variable. |
Operable |
opposite()
Returns the additive inverse of this object. |
Operable |
plus(Operable o)
Returns the sum of this object with the one specified. |
Operable |
times(Operable o)
Returns the product of this object with the one specified. |
java.lang.Object |
toHeap()
Moves this object to the heap. |
static Polynomial |
valueOf(Operable coefficient,
Function.Variable variable)
Returns an univariate polynomial of degree one with the specified coefficient multiplier. |
static Polynomial |
valueOf(Operable coefficient,
Polynomial.Term term)
Returns a polynomial corresponding to the specified term
with the specified coefficient multiplier. |
Methods inherited from class com.dautelle.math.functions.Function |
pow, reciprocal, toString |
Methods inherited from class com.dautelle.realtime.RealtimeObject |
clone, isLocalObject, isPoolObject, recycle |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public static Polynomial valueOf(Operable coefficient, Function.Variable variable)
coefficient
- the coefficient for the variable of degree 1.variable
- the variable for this polynomial.
valueOf(coefficient, Term.valueOf(variable, 1))
public static Polynomial valueOf(Operable coefficient, Polynomial.Term term)
term
with the specified coefficient multiplier.
coefficient
- the coefficient multiplier.term
- the term multiplicand.
coefficient * term
public java.util.Collection getTerms()
public Operable getCoefficient(Polynomial.Term term)
term
- the term for which the coefficient is returned.
null
if this polynomial does not contain the specified term.public int getOrder(Function.Variable v)
public boolean equals(java.lang.Object that)
that
- the object to compare with.
true
if the objects are the same;
false
otherwise.public int hashCode()
public java.util.Set getVariables()
Function
variables
.
getVariables
in class Function
public Operable evaluate()
Function
variables
by their current (context-local) values.
evaluate
in class Function
public java.lang.StringBuffer appendTo(java.lang.StringBuffer sb)
Function
StringBuffer
argument.
appendTo
in class Function
sb
- the StringBuffer
to append.
sb
public Operable plus(Operable o)
Operable
plus
in interface Operable
plus
in class Function
public Operable opposite()
Operable
this.plus(this.opposite()) == ZERO
,
with ZERO
being the additive identity.
opposite
in interface Operable
opposite
in class Function
public Operable times(Operable o)
Operable
times
in interface Operable
times
in class Function
public Function compose(Function f)
Function
compose
in class Function
f
- the function for which the return value is passed as
argument to this function.
(this o that)
public Function differentiate(Function.Variable v)
Function
differentiate
in class Function
v
- the variable for which the derivative is calculated.
d[this]/dv
public Function integrate(Function.Variable v)
Function
integrate
in class Function
v
- the variable for which the integral is calculated.
S[this·dv]
public java.lang.Object export()
Realtime
Realtime
members are exported as well (recursion).
This method affects only objects belonging to the current pool context.
To avoid pool depletion, a "free" object from the outer pool
is moved to replace the object being exported.
export
in interface Realtime
export
in class RealtimeObject
public java.lang.Object toHeap()
Realtime
Realtime
members are moved to the heap as well (recursion).
This method affects only objects belonging to a pool context
(current or not).
toHeap
in interface Realtime
toHeap
in class RealtimeObject
|
JADE v6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |