Main Page | Class List | File List

enl_interp.h

00001 /*********************************************************************
00002  * File  : enl_interp.h
00003  * Author: Sylvain BARTHELEMY
00004  *         mailto:barth@tac-financial.com
00005  *         http://www.barth.netliberte.org
00006  * Date  : 1999-11
00007  *********************************************************************/
00008 
00009 
00010 #ifndef _ENL_INTERP_H_
00011 #define _ENL_INTERP_H_
00012 
00013 // --- cubic splines end condition
00014 // iend = 1 : linear end condition, s(1)=s(n)=0
00015 // iend = 2 : parabolic ends: s(1)=s(2),s(n-1)=s(n)
00016 // iend = 3 : cubic end condition
00017 // iend = 4 : first derivative is known at x(1)
00018 //            and stored in a[1] and the first
00019 //            derivative is know at x(n) and stored
00020 //            in a[2].
00021 const int ENL_CSPLINE_LINEAR    = 1;
00022 const int ENL_CSPLINE_PARABOLIC = 2;
00023 const int ENL_CSPLINE_CUBIC     = 3;
00024 const int ENL_CSPLINE_FDEV      = 4;
00025 
00026 // --- interpolations class
00027 class enl_interp {
00028 
00029   // --- cubic splines end condition
00030   int     m_iend;
00031 
00032   // --- divided differences polynome coef
00033   double* m_dd;
00034 
00035   // --- cspline polynome coef
00036   double* m_a;
00037   double* m_b;
00038   double* m_c;
00039 
00040   // --- orig data
00041   double* m_x;
00042   double* m_y;
00043   int     m_n;
00044 
00045   // --- booleans
00046   bool m_cspline;
00047   bool m_divdiff;
00048 
00049   void divdiff_coef();
00050   void cspline_coef();
00051 
00052 public:
00053   enl_interp(const double* x, const double* y, const int& n);
00054   ~enl_interp();
00055 
00056   double lagrange ( const double& u );
00057   double divdiff  ( const double& u );
00058   double cspline  ( const double& u, int* store);
00059 
00060 
00061 };
00062 
00063 #endif

Generated on Mon Jan 26 22:13:12 2004 for fluid3 by doxygen 1.3.5