gov.sns.tools.fit.spline
Class CubicSpline

java.lang.Object
  |
  +--gov.sns.tools.fit.spline.CubicSpline

public class CubicSpline
extends java.lang.Object


Constructor Summary
CubicSpline(CubicSpline sp)
          constructor of a new spline from another one
CubicSpline(double[] xx, double[] y)
          constructor which takes only the data points
CubicSpline(double[] xx, double[] y, double fp0, double fpn)
          constructor which also takes initial and final slope constraints
 
Method Summary
 void differentiate()
          Differentiates a spline in place.
 double evaluateAt(double xx)
          method to return an interpolated result at a given x value
 void integrate()
          Integrates a spline in place.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CubicSpline

public CubicSpline(CubicSpline sp)
constructor of a new spline from another one


CubicSpline

public CubicSpline(double[] xx,
                   double[] y,
                   double fp0,
                   double fpn)
constructor which also takes initial and final slope constraints

Parameters:
xx - - the data X values
fp0 - - the slope at the starting point
fpn - - the slope at the end point

CubicSpline

public CubicSpline(double[] xx,
                   double[] y)
constructor which takes only the data points

Parameters:
xx - - the data X values
Method Detail

evaluateAt

public double evaluateAt(double xx)
method to return an interpolated result at a given x value

Parameters:
xx - - the x value to evaluate the interpolation at

differentiate

public void differentiate()
Differentiates a spline in place. After calling this routine, a calls to evaluateAt() return the derivative.


integrate

public void integrate()
Integrates a spline in place. After calling this routine, a calls to evaluateAt() return the integral. The constant of integration is chosen such that i(0) = 0.0;