proj home

Files   Classes   Functions   Hierarchy  

vecinterp.h

Go to the documentation of this file.
00001 #ifndef VECINTERP_H
00002 #define VECINTERP_H
00003 
00004 #include <print.h>
00005 
00006 #include <powerseries1D.h>
00007 
00011 template< typename T >
00012 class vecInterp2D0
00013 {
00014 public:
00015   
00016   T p0;
00017   T p1;
00018 
00020   vecInterp2D0(T const & _p0, T const & _p1 ) 
00021     : p0(_p0), p1(_p1) {}
00022 
00024   void operator()( T & val, doublec t) const
00025     { val = p0*(1.0-t) + p1*t; }
00026 
00028   T const operator()(doublec t) const
00029     { T val = p0*(1.0-t) + p1*t; return val; }
00030 
00031 };
00032 
00033 
00045 template< typename T >
00046 class vecInterp2D1
00047 {
00048   static double A0[];
00049   static double B0[];
00050   static double A1[];
00051   static double B1[];
00052   static powerseries1D<double> fA0;
00053   static powerseries1D<double> fB0;
00054   static powerseries1D<double> fA1;
00055   static powerseries1D<double> fB1;
00056 public:
00057   
00058   T p0;
00059   T dp0;
00060   T p1;
00061   T dp1;
00062 
00064   vecInterp2D1
00065   (
00066     T const & _p0,
00067     T const & _dp0,
00068     T const & _p1,
00069     T const & _dp1
00070   ) : p0(_p0), dp0(_dp0), p1(_p1), dp1(_dp1) 
00071     {} 
00072   
00074   void operator()(T & val, doublec t) const
00075     { val = p0*fA0(t) + dp0*fB0(t) + p1*fA1(t) + dp1*fB1(t); }
00076 
00078   T const operator()(doublec t) const
00079     { return p0*fA0(t) + dp0*fB0(t) + p1*fA1(t) + dp1*fB1(t); }
00080     
00081 };
00082 
00083 template< typename T >
00084 double vecInterp2D1<T>::A0[] = { 1.0, 0.0, -3.0, 2.0 };
00085 
00086 template< typename T >
00087 double vecInterp2D1<T>::B0[] = { 0.0, 1.0, -2.0, 1.0 };
00088 
00089 template< typename T >
00090 double vecInterp2D1<T>::A1[] = { 0.0, 0.0, 3.0, -2.0 };
00091 
00092 template< typename T >
00093 double vecInterp2D1<T>::B1[] = { 0.0, 0.0, -1.0, 1.0 };
00094 
00095 template< typename T >
00096 powerseries1D<double> vecInterp2D1<T>::fA0(A0,4);
00097 
00098 template< typename T >
00099 powerseries1D<double> vecInterp2D1<T>::fB0(B0,4);
00100 
00101 template< typename T >
00102 powerseries1D<double> vecInterp2D1<T>::fA1(A1,4);
00103 
00104 template< typename T >
00105 powerseries1D<double> vecInterp2D1<T>::fB1(B1,4);
00106 
00107 
00108 
00109 #endif
00110 
00111 

Generated on Fri Mar 4 00:49:31 2011 for Chelton Evans Source by  doxygen 1.5.8