

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.jscience.mathematics.analysis.taylor.TaylorDouble
public abstract class TaylorDouble
The abstract superclass of all TaylorDouble objects, representing a species of expressions that are automatically Taylor expandable.
Field Summary  

protected double[] 
coeffs
The Taylor coefficients of this TaylorDouble. 
protected boolean 
constant
True for TaylorDoubles that are constant in time, such as constants, parameters or a multiplication of two parameters. 
protected boolean 
independent
True for the independent variable t or another TaylorDouble with only the two first Taylor coefficients nonzero, such as w·t + c. 
protected int 
order
The current order of the expansion of this TaylorDouble. 
Constructor Summary  

TaylorDouble()

Method Summary  

protected abstract void 
calcOrder(int k)
Any TaylorDouble must implement this method for calculation of the kth Taylor coefficient. 
double 
evaluate(double h)
Evaluate at time t = t_{0} + h, where t_{0} is the expansion point; that is evaluate the Taylor expansion f (x,t) = f (t_{0}) + f ' (t_{0})·h + f '' (t_{0}) ·h^{2} + ... 
void 
expandToOrder(int k)
Expand this TaylorDouble variable to order k. 
protected int 
flops(int k)
Return the number of flops required to calculate the kth coefficient of this TaylorDouble. 
double 
getCoeff(int k)
Get the kth Taylor coefficient. 
int 
getOrder()
Get the order of the Taylor expansion. 
abstract void 
reset()
Any TaylorDouble must implement a method to reset, that is to drop it's order to 1 and reset any TaylorDoubles it is dependent on. 
protected void 
setToLength(int k)
Set the size of the coefficient array coeffs[] to k. 
java.lang.String 
toString()
DOCUMENT ME! 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
Field Detail 

protected double[] coeffs
Only the first order + 1 elements are valid, including coeffs[order]. The zeroth coefficient f_{0} = f (t_{0}) is indexed coeffs[0].
The array is typically initialized with 10 elements, but the size is dynamically resized if in need for extra space.
protected int order
protected boolean constant
When a method realizes that an operand of some kind is either constant or independent, it should attempt to optimize code such as not to address the numerous zero coefficients of such TaylorDouble.
protected boolean independent
Constructor Detail 

public TaylorDouble()
Method Detail 

public double evaluate(double h)
public void expandToOrder(int k)
protected abstract void calcOrder(int k)
The TaylorDouble should assume, that it's k1 first coefficients are valid, so that only the kth is to be calculated.
protected int flops(int k)
Notice that flops changes order, so calcOrder and flops should be separated by a call to reset
public abstract void reset()
This strategy has been chosen, since it is difficult/unefficient to communicate the shifting of the expansion point from the independent variable upwards in the dependence tree to the top function value. Instead the top level TaylorDouble function value(s) is reset, which causes the information to propagate downwards to all the TaylorDoubles it is dependent on.
The reset signal is also intended to communicate such thing as the change of a parameter value, which also require all coefficients to be recalculated.
public double getCoeff(int k)
Throws an ArithmeticException if the kth coefficient is not available (yet).
public int getOrder()
public java.lang.String toString()
toString
in class java.lang.Object
protected void setToLength(int k)
If the current order is larger than k1, it is decreased.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 