CBasisSpline1d Class Reference

#include <basis_spline1d.h>

Inheritance diagram for CBasisSpline1d:
[legend]
Collaboration diagram for CBasisSpline1d:
[legend]

List of all members.

Public Member Functions

 CBasisSpline1d (int _l=0, int _m=0, bool r=true, int N=1, double _xmin=0., double _xmax=1., int bsd=3)
 Plain constructor, we must initialize the knots explicitly.
 CBasisSpline1d (const CBasisSpline1d &h)
 Copy constructor, copying knots taken care of by base class.
bool Read (const parameterMap &m)
 Read from parameterMap.
void CopyState (const CBasisSpline1d &a)
double getValue (double r) const
 Get value of Basis Spline at x.
double basisFunction (double x, int i, int jderiv=0) const
 Gets the value of Basis Spline i at x.
virtual double getLeftSupport (int i) const
virtual double getRightSupport (int i) const
bool setDim (int ncoeffs)
 Tool to redim the knots, data and covmtx and keep dimensions in sync. Will hose array contents.

Protected Member Functions

double get_bvalue (const Array1D< double > &bcoef, double x, int jderiv) const
 Calculates value at x of jderiv-th derivative of spline from b-repr. the spline is taken to be continuous from the right, EXCEPT at the rightmost knot, where it is taken to be continuous from the left.
double _weight_denom (int i) const
double _weight_denom (int i, int k) const

Protected Attributes

Array1D< double > _splco


Detailed Description

Definition at line 6 of file basis_spline1d.h.


Constructor & Destructor Documentation

CBasisSpline1d::CBasisSpline1d ( int  _l = 0,
int  _m = 0,
bool  r = true,
int  N = 1,
double  _xmin = 0.,
double  _xmax = 1.,
int  bsd = 3 
) [inline]

Plain constructor, we must initialize the knots explicitly.

Definition at line 9 of file basis_spline1d.h.

CBasisSpline1d::CBasisSpline1d ( const CBasisSpline1d h  )  [inline]

Copy constructor, copying knots taken care of by base class.

Definition at line 14 of file basis_spline1d.h.


Member Function Documentation

double CBasisSpline1d::_weight_denom ( int  i,
int  k 
) const [inline, protected]

Definition at line 39 of file basis_spline1d.h.

double CBasisSpline1d::_weight_denom ( int  i  )  const [inline, protected]

Definition at line 38 of file basis_spline1d.h.

double CBasisSpline1d::basisFunction ( double  x,
int  i,
int  jderiv = 0 
) const [virtual]

Gets the value of Basis Spline i at x.

Parameters:
i Basis Spline index
x value to evaluate spline at
jderiv order of derivative to take

Reimplemented from CGenericSpline1d.

Definition at line 34 of file basis_spline1d.cc.

void CBasisSpline1d::CopyState ( const CBasisSpline1d a  )  [inline]

Definition at line 21 of file basis_spline1d.h.

double CBasisSpline1d::get_bvalue ( const Array1D< double > &  bcoef,
double  x,
int  jderiv 
) const [protected]

Calculates value at x of jderiv-th derivative of spline from b-repr. the spline is taken to be continuous from the right, EXCEPT at the rightmost knot, where it is taken to be continuous from the left.

From "A Practical Guide to Splines" by C. De Boor

Parameters:
x the point at which to evaluate .
bcoef b-coefficient sequence, of length _nc
jderiv integer giving the order of the derivative to be evaluated assumed to be zero or positive.
Warning:
The restriction k .le. kmax (=20) is imposed arbitrarily by the dimension statement for aj, dl, dr below, but is nowhere checked for.
Return values:
bvalue the value of the (jderiv)-th derivative of $f$ at $x$ .
The nontrivial knot interval $(t_i,t_{i+1})$ containing $x$ is located with the aid of interv . The $k$ b-coeffs of $f$ relevant for this interval are then obtained from _coeffs (or taken to be zero if not explicitly available) and are then differenced jderiv times to obtain the b-coeffs of $ d^{jderiv}f $ relevant for that interval. Precisely, with $j = jderiv$, we have from x.(12) of the text that

$ d^jf = \sum bcoef(.,j)*b(.,k-j,t) $

where $ bcoef(.,j) = \left\{ \begin{array}{ll} bcoef(.) & \mbox{if}\; j = 0 \\ \frac{\displaystyle bcoef(.,j-1) - bcoef(.-1,j-1) }{\displaystyle (t_{.+k-j} - t_{.})/(k-j)} & j > 0 \end{array} \right. $

Then, we use repeatedly the fact that $\sum ( a(.)*b_{.,m,t}(x) ) = \sum ( a(.,x)*b_{.,m-1,t}(x) )$ with $a(.,x) =\frac{(x-t(.))*a(.)+(t(.+m-1)-x)*a(.-1)}{(x-t(.))+(t(.+m-1)-x)}$ to write $d^j f(x)$ eventually as a linear combination of b-splines of order 1 , and the coefficient for $b_{i,1,t}(x)$ must then be the desired number $d^jf(x)$. (see x.(17)-(19) of text).

Definition at line 95 of file basis_spline1d.cc.

virtual double CBasisSpline1d::getLeftSupport ( int  i  )  const [inline, virtual]

Reimplemented from CGenericSpline1d.

Definition at line 29 of file basis_spline1d.h.

virtual double CBasisSpline1d::getRightSupport ( int  i  )  const [inline, virtual]

Reimplemented from CGenericSpline1d.

Definition at line 30 of file basis_spline1d.h.

double CBasisSpline1d::getValue ( double  x  )  const [virtual]

Get value of Basis Spline at x.

Warning:
The resulting spline is not left continuous at the left-most knot

Reimplemented from CBasisFunctionExpansion1d.

Definition at line 21 of file basis_spline1d.cc.

bool CBasisSpline1d::Read ( const parameterMap m  ) 

Read from parameterMap.

Reimplemented from CGenericSpline1d.

Reimplemented in CSourceFtn1dBSpline.

Definition at line 10 of file basis_spline1d.cc.

bool CBasisSpline1d::setDim ( int  ncoeffs  )  [virtual]

Tool to redim the knots, data and covmtx and keep dimensions in sync. Will hose array contents.

Reimplemented from CGenericSpline1d.

Definition at line 188 of file basis_spline1d.cc.


Member Data Documentation

Array1D<double> CBasisSpline1d::_splco [protected]

Definition at line 36 of file basis_spline1d.h.


The documentation for this class was generated from the following files:

Generated on Fri Feb 6 13:30:17 2009 for CorAL by  doxygen 1.5.8