#include <PsPolatorAndPsNumericType.h>
Inheritance diagram for PsNumericType:


Public Methods | |
| virtual | ~PsNumericType (void) |
| Destructor. | |
| virtual double | getValue (void) const=0 |
| get the value of the numeric type as a double | |
Static Public Methods | |
| double | linearInterpolate (const long t, const long t1, const double v1, const long t0, const double v0) |
| calculate linear interpolation between two values | |
| double | quadraticInterpolate (const long t, const long t2, const double v2, const long t1, const double v1, const long t0, const double v0) |
| calculate 2nde degre interpolation between 3 values | |
| double | cubicInterpolate (const long t, const long t3, const double v3, const long t2, const double v2, const long t1, const double v1, const long t0, const double v0) |
| calculate 3rd degre interpolation with 4 values | |
| double | linearExtrapolate (const long t, const long t1, const double v1, const long t0, const double v0) |
| linear extrapolation | |
| double | quadraticExtrapolate (const long t3, const long t2, const double v2, const long t1, const double v1, const long t0, const double v0) |
| quadratic extrapolation | |
| double | cubicExtrapolate (const long t4, const long t3, const double v3, const long t2, const double v2, const long t1, const double v1, const long t0, const double v0) |
| cubicExtrapolate | |
Definition at line 30 of file PsPolatorAndPsNumericType.h.
|
|
Destructor.
Definition at line 34 of file PsPolatorAndPsNumericType.h.
00035 {} ;
|
|
||||||||||||||||||||||||||||||||||||||||
|
cubicExtrapolate
Definition at line 151 of file PsNumericTypeT.cxx. References quadraticExtrapolate(). Referenced by PsNumericPolatorT< Type >::antepolate(), and PsNumericPolatorT< Type >::extrapolate().
00161 {
00162 double deltaValeur = quadraticExtrapolate(t4 - t0,
00163 t3 - t0,
00164 v3 - v0,
00165 t2 - t0,
00166 v2 - v0,
00167 t1 - t0,
00168 v1 - v0);
00169 return v0 + deltaValeur ;
00170 }
|
|
||||||||||||||||||||||||||||||||||||||||
|
calculate 3rd degre interpolation with 4 values
Definition at line 82 of file PsNumericTypeT.cxx. References quadraticInterpolate(). Referenced by PsNumericPolatorT< Type >::interpolate().
00091 {
00092 return v0 + quadraticInterpolate(t - t0,
00093 t3 - t0,
00094 v3 - v0,
00095 t2 - t0,
00096 v2 - v0,
00097 t1 - t0,
00098 v1 - v0);
00099 }
|
|
|
get the value of the numeric type as a double
Implemented in PsNumericTypeT< Type >. |
|
||||||||||||||||||||||||
|
linear extrapolation
Definition at line 102 of file PsNumericTypeT.cxx. Referenced by PsNumericPolatorT< Type >::antepolate(), PsNumericPolatorT< Type >::extrapolate(), and quadraticExtrapolate().
00108 {
00109 #ifdef _DEBUGPOLATION
00110 cerr<<"linearExtrapolate ("<<t<<","<<t1<<","<<v1<<","<<t0<<","<<v0<<") = ";
00111 #endif
00112 long d0 = (t1 - t0);
00113 //assert ( false ) ;
00114 assert(t1 != -1) ;
00115 assert(t != -1) ;
00116 assert ( t != t1 ) ;
00117 double resul = ( (t - t1) * (v1 - v0) )/ d0 + v1;
00118 #ifdef _DEBUGPOLATION
00119 cerr<<resul<<endl;
00120 #endif
00121 return ( (t - t1) * (v1 - v0) )/ d0 + v1 ;
00122 }
|
|
||||||||||||||||||||||||
|
calculate linear interpolation between two values
Definition at line 48 of file PsNumericTypeT.cxx. Referenced by PsNumericPolatorT< Type >::interpolate(), and quadraticInterpolate().
00055 {
00056 #ifdef _DEBUGPOLATION
00057 cerr<<"linearInterpolate("<<t<<" "<<t1<<" "<<v1<<" "<<t0<<" "<<v0<<") = "<<endl;
00058 #endif
00059 long d0 = t1 - t0 ;
00060 assert ( d0 != 0) ;
00061 #ifdef _DEBUGPOLATION
00062 cerr<< ( v1 * (t - t0 ) + v0 * ( t1 - t )) / d0 <<endl;
00063 #endif
00064 return ( v1 * (t - t0 ) + v0 * ( t1 - t )) / d0 ;
00065 }
|
|
||||||||||||||||||||||||||||||||
|
quadratic extrapolation
Definition at line 126 of file PsNumericTypeT.cxx. References linearExtrapolate(). Referenced by PsNumericPolatorT< Type >::antepolate(), cubicExtrapolate(), and PsNumericPolatorT< Type >::extrapolate().
00133 {
00134 #ifdef _DEBUGPOLATION
00135 cerr<<"quadraticExtrapolate ("<<t3<<","<<t2<<","<<v2<<","<<t1<<","<<v1<<","<<t0<<","<<v0<<") = ";
00136 #endif
00137 //on utilise linearExtrapolate pour compute l'accroissement en t2 et t3
00138 double deltaValeur = linearExtrapolate(t3-t0,
00139 t2-t0,
00140 v2-v0,
00141 t1-t0,
00142 v1-v0);
00143 #ifdef _DEBUGPOLATION
00144 cerr<<v2+deltaValeur<<endl;
00145 #endif
00146 return v0+deltaValeur ;
00147 }
|
|
||||||||||||||||||||||||||||||||
|
calculate 2nde degre interpolation between 3 values
Definition at line 69 of file PsNumericTypeT.cxx. References linearInterpolate(). Referenced by cubicInterpolate(), and PsNumericPolatorT< Type >::interpolate().
00077 {
00078 return v0 + linearInterpolate(t-t0,t2-t0,v2-v0,t1-t0,v1-v0) ;
00079 }
|
| Documentation generated on Mon Nov 25 15:26:16 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |