#include <Spl.hh>
Inheritance diagram for RazorBack::Spl_:
Public Methods | |
Spl_ (unsigned int N=2) | |
Inits to work on N data points (default 2). | |
unsigned int | len () const |
Returns the current length of the data vectors. | |
unsigned int | len (unsigned int L) |
Sets the data vector length to L. More... | |
void | reset () |
Zeroes all data vectors and prepares for a new fit. | |
void | add (unsigned int Idx, double x, double y) |
add(Idx, x, y): adds a pair of independent (x) and dependent (y) variable points to the Idx-th [0..len()-1] position of the calling object. More... | |
void | fit_spl (double yp1, bool Nat1, double ypn, bool Natn) |
fit_spl(yp1, Nat1, ypn, Natn): fits a cubic spline to a series of data points already stored in the calling object. More... | |
double | eval_spl (double xi, double *Der1=NULL, double *Der2=NULL, double *Der3=NULL, double *Integ=NULL) const |
eval_spl(xi, Der1, Der2, Der3, Integ): evaluates a spline at a point xi. More... | |
double | integ_spl (double Low, double Up) const |
integ_spl(Low, Up): returns the definite integral of the spline Spl between Low and Up. More... | |
Private Methods | |
bool | check_data () |
double | int_0x (double xi) const |
double | smallest_interval (double xi, unsigned int &kl, unsigned int &kh) const |
Can be queried for interpolated values, 1st..3rd derivatives and integrals.
Definition at line 114 of file Spl.hh.
|
Inits to work on N data points (default 2).
|
|
Returns the current length of the data vectors.
|
|
Sets the data vector length to L. Does nothing if L==0 or if L==len(). Returns the old length. |
|
Zeroes all data vectors and prepares for a new fit.
|
|
add(Idx, x, y): adds a pair of independent (x) and dependent (y) variable points to the Idx-th [0..len()-1] position of the calling object. Indexrangexc_ will be thrown if Idx is illegal. Use this method to "fill" up the spline object before fitting. |
|
fit_spl(yp1, Nat1, ypn, Natn): fits a cubic spline to a series of data points already stored in the calling object. Does not do anything if the fit has already been done. Throws Emptyexc if the calling object was empty. Throws Generalexc_ if there were duplicate data points. yp1: user-supplied first derivative at the 1st point. If Nat1 is true, then the value of yp1 is ignored and instead a zero 2nd derivative is assumed (natural spline). ypn, Natn: the same for the last point. |
|
eval_spl(xi, Der1, Der2, Der3, Integ): evaluates a spline at a point xi. If xi is out of range then 0.0 is returned. Otherwise the return value is y(xi). Adapted from Numerical Recipes. The derivatives and the integral are returned only if they are not NULL: this way, the user can calc any combination of the first three derivatives and the integral. xi: interpolation point Der1..3: 1st..3rd derivative of y at xi Integ: definite integral of y(x) between X[0] and xi. The derivative and integral ptrs are NULL by default. Prints a warning and returns 0.0 if the values were modified. Throws Emptyexc_ if the calling object was empty. Throws Argexc_ if xi was out of range. |
|
integ_spl(Low, Up): returns the definite integral of the spline Spl between Low and Up. Prints a warning and returns 0.0 if spl_fit() was not invoked before calling this method. Throws Argexc_ if Low or Up are out of the fitted interval. |
|
|
|
|
|
|