nr
Class PolynomialExtrapolator

java.lang.Object
  extended by nr.PolynomialExtrapolator
All Implemented Interfaces:
Extrapolator

public class PolynomialExtrapolator
extends java.lang.Object
implements Extrapolator

Extrapolator based on pzextr in Numberical Recipes section 16.4

Author:
Daniel Wachsstock

Constructor Summary
PolynomialExtrapolator()
          Create a new instance of PolynomialExtrapolator with a default initial size.
PolynomialExtrapolator(int n)
          Create a new instance of PolynomialExtrapolator with initial tableau size n
 
Method Summary
 void add(double x, Vec y, Vec dy)
          add a new data set to the extrapolation
 double getTarget()
          the target x value
 void reset()
          reset the extrapolation (discard all previous points)
 void setTarget(double x)
          change the target
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolynomialExtrapolator

public PolynomialExtrapolator(int n)
Create a new instance of PolynomialExtrapolator with initial tableau size n


PolynomialExtrapolator

public PolynomialExtrapolator()
Create a new instance of PolynomialExtrapolator with a default initial size.

Method Detail

add

public void add(double x,
                Vec y,
                Vec dy)
Description copied from interface: Extrapolator
add a new data set to the extrapolation

Specified by:
add in interface Extrapolator
Parameters:
x - the input x value
y - the input y value. On return, is updated to the value of y extrapolated to x == target X.
dy - on output, updated to the error estimate in each element of y. If dy == null, then is ignored.

reset

public void reset()
Description copied from interface: Extrapolator
reset the extrapolation (discard all previous points)

Specified by:
reset in interface Extrapolator

setTarget

public void setTarget(double x)
Description copied from interface: Extrapolator
change the target

Specified by:
setTarget in interface Extrapolator
Parameters:
x - the new target x

getTarget

public double getTarget()
Description copied from interface: Extrapolator
the target x value

Specified by:
getTarget in interface Extrapolator
Returns:
the target