Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

delta.h

Go to the documentation of this file.
00001 
00034 template <class T>
00035 class delta_trans
00036 {
00037 public:
00042   void forward( T *vec, size_t len )
00043   {
00044     if (vec != 0 && len > 0) {
00045       // reference value
00046       T next;
00047       T refVal = vec[0];
00048 
00049       for (size_t i = 1; i < len; i++) {
00050         next = vec[i];
00051         vec[i] = vec[i] - refVal;
00052         refVal = next;
00053       }
00054     }
00055   } // forward
00056 
00057   void inverse( T *vec, size_t len )
00058   {
00059     if (vec != 0 && len > 0) {
00060       for (size_t i = 1; i < len; i++) {
00061         vec[i] = vec[i] + vec[i-1];
00062       }
00063     }
00064   } // inverse
00065 
00066 }; // delta_trans

Generated at Tue May 27 21:56:16 2003 for Wavelet compression, determinism and time series forecasting by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001