Changeset 768 in Sophya for trunk/SophyaProg/Tests/tfft.cc
- Timestamp:
- Mar 2, 2000, 6:19:19 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/Tests/tfft.cc
r715 r768 1 #include "machdefs.h" 2 1 3 #include <math.h> 2 4 #include <iostream.h> 3 5 6 #include "nbrandom.h" 4 7 #include "fftpserver.h" 5 8 #include "fftmserver.h" 6 #include "sambainit.h" 9 #include "fftwserver.h" 10 #include "ntoolsinit.h" 7 11 8 12 #include "timing.h" 9 13 14 15 static bool inp_typ_random = false ; // true -> random input 10 16 11 17 template <class T> … … 37 43 cout << " DBG/4 outc " << outc.NElts() << endl; 38 44 39 for (int i=0; i<num ; i++){ 45 if (inp_typ_random) 46 for (int i=0; i<num ; i++){ 47 ino[i] = in[i] = GauRnd(0., 1.); 48 inc[i] = complex<T> (in[i], 0.); 49 } 50 else for (int i=0; i<num ; i++){ 40 51 ino[i] = in[i] = 0.5 + cos(2*M_PI*(double)i/(double)num) 41 52 + 2*sin(4*M_PI*(double)i/(double)num); … … 158 169 { 159 170 160 PeidaInit();171 SophyaInit(); 161 172 InitTim(); // Initializing the CPU timer 162 173 163 174 if (narg < 4) { 164 cout << "tfft/ args error - \n Usage tfft size p/P/M f/d [NPrtFC NPrt] \n" 165 << " p=FFTPackTest P=FFTPack, M=FFTMayer, f=float, d=double " << endl; 175 cout << "tfft/ args error - \n Usage tfft size px/Px/Mx/Wx f/d [NPrtFC NPrt] \n" 176 << " p=FFTPackTest P=FFTPack, M=FFTMayer, W= FFTWServer" 177 << " x=0 -> Random input - f=float, d=double " << endl; 166 178 exit(0); 167 179 } … … 169 181 FFTPackServer fftp; 170 182 FFTMayerServer fftm; 183 184 FFTWServer fftw; 185 186 inp_typ_random = false; 187 if (arg[2][1] == '0') inp_typ_random = true; 171 188 172 189 int sz = atoi(arg[1]); … … 177 194 FFTServerInterface * ffts; 178 195 if (*arg[2] == 'M') ffts = fftm.Clone(); 196 else if (*arg[2] == 'W') ffts = fftw.Clone(); 179 197 else ffts = fftp.Clone(); 180 198
Note:
See TracChangeset
for help on using the changeset viewer.