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

line_norm.h

Go to the documentation of this file.
00001 
00002 #ifndef _LINE_NORM_H_
00003 #define _LINE_NORM_H_
00004 
00005 #include "line.h"
00006 
00012 template <class T>
00013 class line_norm : public line<T> {
00014 
00015 protected:
00044   void normalize( T& vec, int N, transDirection direction )
00045   {
00046     const double sqrt2 = sqrt( 2.0 );
00047     int half = N >> 1;
00048 
00049     for (int i = 0; i < half; i++) {
00050       int j = i + half;
00051 
00052       if (direction == forward) {
00053         vec[i] = sqrt2 * vec[i];
00054         vec[j] = vec[j]/sqrt2;
00055       }
00056       else if (direction == inverse) {
00057         vec[i] = vec[i]/sqrt2;
00058         vec[j] = sqrt2 * vec[j];
00059       }
00060       else {
00061         printf("normalize: bad direction value\n");
00062       }
00063     } // for
00064   } // normalize
00065 
00069   void inverseStep( T& vec, const int n )
00070   {
00071     normalize( vec, n, inverse );
00072     update( vec, n, inverse );
00073     predict( vec, n, inverse );
00074     merge( vec, n );
00075   }  // inverseStep
00076 
00080   void forwardStep( T& vec, const int n )
00081   {
00082     split( vec, n );
00083     predict( vec, n, forward );
00084     update( vec, n, forward );
00085     normalize( vec, n, forward );
00086   } // forwardStep
00087 
00088 };
00089 
00090 #endif

Generated at Thu May 22 21:12:35 2003 for Hurst Exponent Calculation and Supporting Statistics by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001