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