00001 #ifndef __BASIS_SPLINE_H__
00002 #define __BASIS_SPLINE_H__
00003
00004 #include "generic_spline1d.h"
00005
00006 class CBasisSpline1d: public CGenericSpline1d {
00007 public:
00009 CBasisSpline1d(int _l=0, int _m=0, bool r=true, int N=1, double _xmin=0., double _xmax=1., int bsd=3):
00010 CGenericSpline1d(_l,_m,r,N,_xmin,_xmax,bsd), _splco(N,0.)
00011 {Array1D<double>tmp(N+spline_degree+1,0.);knots=tmp;min_deriv=-1;max_deriv=spline_degree;}
00012
00014 CBasisSpline1d(const CBasisSpline1d& h):
00015 CGenericSpline1d(h), _splco(h._splco){}
00016
00017
00018 bool Read(const parameterMap& m);
00019
00020
00021 void CopyState(const CBasisSpline1d& a)
00022 {CGenericSpline1d::CopyState(a);_splco=a._splco;}
00023
00024
00025 double getValue(double r) const;
00026 double basisFunction(double x, int i, int jderiv=0) const;
00027
00028
00029 virtual double getLeftSupport(int i) const{return knots[i];}
00030 virtual double getRightSupport(int i) const{return knots[i+spline_degree+1];}
00031
00033 bool setDim(int ncoeffs);
00034
00035 protected:
00036 Array1D<double> _splco;
00037 double get_bvalue(const Array1D<double>& bcoef, double x, int jderiv) const;
00038 double _weight_denom(int i) const{return _weight_denom(i,spline_degree);}
00039 double _weight_denom(int i, int k) const{return knots[i+k]-knots[i];}
00040 };
00041
00042 #endif