Changeset 768 in Sophya for trunk/SophyaProg/Tests/tfft.cc


Ignore:
Timestamp:
Mar 2, 2000, 6:19:19 PM (26 years ago)
Author:
ansari
Message:

Reorganisation - PeidaInit() -> SophyaInit() - Reza 2/3/2000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaProg/Tests/tfft.cc

    r715 r768  
     1#include "machdefs.h"
     2
    13#include <math.h>
    24#include <iostream.h>
    35
     6#include "nbrandom.h"
    47#include "fftpserver.h"
    58#include "fftmserver.h"
    6 #include "sambainit.h"
     9#include "fftwserver.h"
     10#include "ntoolsinit.h"
    711
    812#include "timing.h"
    913
     14
     15static bool inp_typ_random = false ;  // true -> random input
    1016
    1117template <class T>
     
    3743  cout << " DBG/4 outc " << outc.NElts()  << endl;
    3844
    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++){
    4051    ino[i] = in[i] = 0.5 + cos(2*M_PI*(double)i/(double)num)
    4152                         + 2*sin(4*M_PI*(double)i/(double)num);
     
    158169{
    159170
    160   PeidaInit();
     171  SophyaInit();
    161172  InitTim();   // Initializing the CPU timer
    162173
    163174  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;
    166178    exit(0);
    167179  }
     
    169181  FFTPackServer fftp;
    170182  FFTMayerServer fftm;
     183
     184  FFTWServer fftw;
     185
     186  inp_typ_random = false;
     187  if (arg[2][1] == '0')  inp_typ_random = true;
    171188
    172189  int sz = atoi(arg[1]);
     
    177194  FFTServerInterface * ffts;
    178195  if (*arg[2] == 'M')  ffts = fftm.Clone();
     196  else if (*arg[2] == 'W')  ffts = fftw.Clone();
    179197  else ffts = fftp.Clone();
    180198
Note: See TracChangeset for help on using the changeset viewer.