00001 #ifndef GCUBIC_SPLINE_INTERPOL_H 00002 #define GCUBIC_SPLINE_INTERPOL_H 00003 00004 #include "GObject.h" 00005 #include "GMatrix.h" 00006 #include "GVector.h" 00007 #include "GLinear_Homo_Eq.h" 00008 00009 namespace GMathLib{ 00010 00014 struct GCubicFncData 00015 { 00016 //S_i = a_i*x_i^3 + b_i*x_i^2 + c_i*x_i + d_i 00017 double a; 00018 double b; 00019 double c; 00020 double d; 00021 }; 00022 00029 class GCubic_Spline_Interpolation : public GObject 00030 { 00031 public: 00035 GCubic_Spline_Interpolation(); 00036 00040 ~GCubic_Spline_Interpolation(); 00041 00049 void Prepair(int gridp_num); 00050 00051 00061 int DoInterpolation(GMatrix& discre_mx); 00062 00063 00070 GCubicFncData* GetCubicFuncData(){ 00071 return p_cfData; 00072 } 00073 00074 private: 00075 GCubicFncData* p_cfData; 00076 GMatrix* p_at; 00077 GVector* p_u; 00078 GVector* p_v; 00079 GVector* p_h; 00080 GLinear_Homo_Eq ln_hm_solver; 00081 00082 }; 00083 00084 } 00085 #endif 00086