Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals

rtrsmrawavdrs.cpp

Go to the documentation of this file.
00001 // rtrsmrawavdrs.cpp
00002 
00003 //////////////////////////////////////////////////////////////////////
00004 //          (c) Copyright 2000-2002 Brown Deer Technology, LLC.
00005 //                        All rights reserved.
00006 //////////////////////////////////////////////////////////////////////
00007 
00008 #ifdef USE_STD
00009 #include <cmath>
00010 using namespace std;
00011 #else
00012 #include <math.h>
00013 #endif
00014 
00015 #ifdef STORM_USEF
00016 #include "rtrsmrawavdrs_.h"
00017 #include "drtrsmrawavdrs_.h"
00018 #include "irtrsmrawavdrs_.h"
00019 #include "artrsmrawavdrs1_.h"
00020 #include "dartrsmrawavdrs1_.h"
00021 #include "iartrsmrawavdrs1_.h"
00022 #endif
00023 
00024 #include "stormdef.h"
00025 #define INVSQRT2 STORMDEF_MATHCONST_INVSQRT2
00026 
00027 void rtrsmrawavdrs( 
00028           const int& Msize,
00029           const int& mmax,
00030           const int& mrastep,
00031           const float* mracoef,
00032           const float* mracoefrs,
00033           const int& m,
00034                 float& wavdrs
00035 ) 
00036 { 
00037 #ifdef STORM_USEF
00038    rtrsmrawavdrs_( 
00039      &Msize, 
00040      &mmax, 
00041      &mrastep, mracoef, mracoefrs,
00042      &m, &wavdrs
00043    );
00044 #else
00045 //   if ( ( m >= 0 ) && ( m <= mmax ) ) {
00046       wavdrs = mracoefrs[ 2*m +1 ] * pow(INVSQRT2,m);
00047 //   } else {
00048 //       wavdrs = 1.0/0;
00049 //   }
00050 #endif
00051 }
00052 
00053 
00054 void rtrsmrawavdrs( 
00055           const int& Msize,
00056           const int& mmax,
00057           const int& mrastep,
00058           const double* mracoef,
00059           const double* mracoefrs,
00060           const int& m,
00061                 double& wavdrs
00062 ) 
00063 { 
00064 #ifdef STORM_USEF
00065    drtrsmrawavdrs_( 
00066      &Msize, 
00067      &mmax, 
00068      &mrastep, mracoef, mracoefrs,
00069      &m, &wavdrs
00070    );
00071 #else
00072 //   if ( ( m >= 0 ) && ( m <= mmax ) ) {
00073       wavdrs = mracoefrs[ 2*m + 1 ] * pow(INVSQRT2,m);
00074 //   } else {
00075 //      wavdrs = 1.0/0;
00076 //   }
00077 #endif
00078 } 
00079 
00080 
00081 void rtrsmrawavdrs( 
00082           const int& Msize,
00083           const int& mmax,
00084           const int& mrastep,
00085           const int* mracoef,
00086           const int* mracoefrs,
00087           const int& m,
00088                 int& wavdrs
00089 ) 
00090 { 
00091 #ifdef STORM_USEF
00092    irtrsmrawavdrs_( 
00093      &Msize, 
00094      &mmax, 
00095      &mrastep, mracoef, mracoefrs,
00096      &m, &wavdrs
00097    );
00098 #else
00099 //   if ( ( m >= 0 ) && ( m <= mmax ) ) {
00100       int tmp = mracoefrs[ 2*m + 1 ];
00101       if (tmp >= 0) {
00102          wavdrs = tmp >> m;
00103       } else {
00104          if ((tmp & 0x00000001) != 0) {
00105             wavdrs = - ( (-tmp) >> m);
00106          } else {
00107             wavdrs = - ( (-tmp) >> m) - 1;
00108          }
00109       }
00110 //   } else {
00111 //      wavdrs = 1.0/0;
00112 //   }
00113 #endif
00114 } 
00115 
00116 
00117 void rtrsmrawavdrs(
00118           const int& Asize,
00119           const int& Msize,
00120           const int& amax,
00121           const int& mmax,
00122           const int& mrastep,
00123           const float* mracoef,
00124           const float* mracoefrs,
00125           const int& a,
00126           const int& m,
00127                 float& wavdrs
00128 )
00129 {
00130 #ifdef STORM_USEF
00131    artrsmrawavdrs1_(
00132      &Asize, &Msize,
00133      &amax, &mmax,
00134      &mrastep, mracoef, mracoefrs,
00135      &a, &m, &wavdrs
00136    );
00137 #else
00138 //   if ( ( a >= 0 ) && ( a <= amax ) && ( m >= 0 ) && ( m <= mmax ) ) {
00139       wavdrs = mracoefrs[ Msize*2*a + 2*m + 1 ] * pow(INVSQRT2,m);
00140 //   } else {
00141 //      wavdrs = 1.0/0;
00142 //   }
00143 #endif
00144 }
00145 
00146 
00147 void rtrsmrawavdrs(
00148           const int& Asize,
00149           const int& Msize,
00150           const int& amax,
00151           const int& mmax,
00152           const int& mrastep,
00153           const double* mracoef,
00154           const double* mracoefrs,
00155           const int& a,
00156           const int& m,
00157                 double& wavdrs
00158 )
00159 {
00160 #ifdef STORM_USEF
00161    dartrsmrawavdrs1_(
00162      &Asize, &Msize,
00163      &amax, &mmax,
00164      &mrastep, mracoef, mracoefrs,
00165      &a, &m, &wavdrs
00166    );
00167 #else
00168 //   if ( ( a >= 0 ) && ( a <= amax ) && ( m >= 0 ) && ( m <= mmax ) ) {
00169       wavdrs = mracoefrs[ Msize*2*a + 2*m + 1 ] * pow(INVSQRT2,m);
00170 //   } else {
00171 //      wavdrs = 1.0/0;
00172 //   }
00173 #endif
00174 }
00175 
00176 
00177 void rtrsmrawavdrs(
00178           const int& Asize,
00179           const int& Msize,
00180           const int& amax,
00181           const int& mmax,
00182           const int& mrastep,
00183           const int* mracoef,
00184           const int* mracoefrs,
00185           const int& a,
00186           const int& m,
00187                 int& wavdrs
00188 )
00189 {
00190 #ifdef STORM_USEF
00191    iartrsmrawavdrs1_(
00192      &Asize, &Msize,
00193      &amax, &mmax,
00194      &mrastep, mracoef, mracoefrs,
00195      &a, &m, &wavdrs
00196    );
00197 #else
00198 //   if ( ( a >= 0 ) && ( a <= amax ) && ( m >= 0 ) && ( m <= mmax ) ) {
00199       int tmp = mracoefrs[ Msize*2*a + 2*m + 1 ];
00200       if (tmp >= 0) {
00201          wavdrs = tmp >> m;
00202       } else {
00203          if ((tmp & 0x00000001) != 0) {
00204             wavdrs = - ( (-tmp) >> m);
00205          } else {
00206             wavdrs = - ( (-tmp) >> m) - 1;
00207          }
00208       }
00209 //   } else {
00210 //      wavdrs = 1/0;
00211 //   }
00212 #endif
00213 }
00214 

Generated on Mon May 31 21:38:53 2004 for SR2k4 Assembler by doxygen 1.3.6