00001 00005 class BSpline 00006 00007 { 00008 protected: 00009 00010 SplineSpace space; 00011 Vec(NUMT) coef; 00012 SplineCurveInterpolBox Ibox; 00013 Handle(MatBand(NUMT)) A; 00014 00015 NUMT funcValue(int order, real x); 00016 00017 00018 public: 00019 00020 BSpline() {} 00021 ~BSpline() {} 00022 00023 bool redim(const SplineSpace& space_) { 00024 return this->space.redim(space_); 00025 } 00026 bool ok() const 00027 { return getbool 00028 ( space.ok() && coef.ok() && coef.size()==space.dimension() ); } 00029 00030 SplineSpace getSpace() const; 00031 00032 void getCoef(Vec(NUMT)& c) const { int m=coef.size(); c.redim(m); c=coef;} 00033 void setCoef(const Vec(NUMT)& c) { coef.redim(c.size()); coef=c; } 00034 00035 NUMT operator () (real x); 00036 NUMT derivative(int order, real x); 00037 00038 void makeTable 00039 (const VecSimple(real)& vx, 00040 VecSimple(NUMT)& fx); 00041 00042 void interpolation(const VecSimple(real)& x, const VecSimple(NUMT)& f, 00043 bool repeat = false); 00044 00045 void leastSquareInterpolation 00046 (const VecSimple(real)& x, const VecSimple(NUMT)& f); 00047 00048 void leastSquareInterpolation 00049 (const VecSimple(real)& x, const VecSimple(NUMT)& f, 00050 const VecSimple(real)& weights); 00051 00052 void linearInterpolation(const VecSimple(real)& x, const VecSimple(NUMT)& f); 00053 00054 void quadraticInterpolation(const VecSimple(real)& x, 00055 const VecSimple(NUMT)& f); 00056 00057 void cubicHermiteInterpolation(const VecSimple(real)& x, 00058 const VecSimple(NUMT)& f, 00059 const VecSimple(real)& df); 00060 00061 void cubicInterpolation(const VecSimple(real)& x, 00062 const VecSimple(NUMT)& f, 00063 const char* boundcond = "Free", 00064 bool repeat = false); 00065 00066 00067 void scan(Is is); 00068 }; 00069 00070