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


Ignore:
Timestamp:
Apr 7, 2000, 1:35:43 PM (25 years ago)
Author:
ansari
Message:

Adaptation TArray de tfft.cc - Reza 7/4/2000

File:
1 edited

Legend:

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

    r768 r836  
    5555 
    5656
    57   cout << "Input / L = " << num << endl;
    58   in.Print(0,0,nprt,0,nprt);
     57  cout << "Input / L = " << num << in;
    5958  cout << endl;
    6059
     
    6463  fftp.fftf(in.NElts(), in.Data());
    6564  //  in /= (num/2.);
    66   cout << " fftp.fftf(in.NElts(), in.Data()) FORWARD: " << endl;
    67   in.Print(0,0,nprtfc,0,nprtfc);
     65  cout << " fftp.fftf(in.NElts(), in.Data()) FORWARD: " << in << endl;
    6866  cout << endl;
    6967  fftp.fftb(in.NElts(), in.Data());
    70   cout << " fftp.fftb(in.NElts(), in.Data()) BACKWARD: " << endl;
    71   in.Print(0,0,nprt,0,nprt);
     68  cout << " fftp.fftb(in.NElts(), in.Data()) BACKWARD: " << in <<endl;
    7269  cout << endl;
    7370  dif = ino-in;
    74   cout << " dif , NElts= " << dif.NElts() << endl;
    75   dif.Print(0,0,nprt,0,nprt);
     71  cout << " dif , NElts= " << dif.NElts() << dif << endl;
    7672
    7773  int ndiff = 0;
     
    109105  cout << " Testing FFTServer " << ffts.getInfo() << endl;
    110106
    111   cout << "Input / L = " << num << endl;
    112   in.Print(0,0,nprt,0,nprt);
     107  cout << "Input / L = " << num << in << endl;
    113108  cout << endl;
    114109
     
    117112  cout << "\n ----  Testing FFT(T, complex<T>) ---- " << endl;
    118113  ffts.FFTForward(in, outc);
    119   cout << " FourierCoefs , NElts= " << outc.NElts() << endl;
    120   outc.Print(0,0,nprtfc,0,nprtfc);
     114  cout << " FourierCoefs , NElts= " << outc.NElts() << outc << endl;
    121115
    122116  ffts.FFTBackward(outc, bk);
    123   cout << " Backward , NElts= " << bk.NElts() << endl;
    124   bk.Print(0,0,nprt,0,nprt);
     117  cout << " Backward , NElts= " << bk.NElts() << bk << endl;
    125118 
    126119  dif = bk*fact - in;
    127   cout << " Difference , NElts= " << dif.NElts() << endl;
    128   dif.Print(0,0,nprt,0,nprt);
     120  cout << " Difference , NElts= " << dif.NElts() << dif << endl;
    129121
    130122  ndiff = 0;
     
    140132  cout << "\n ----  Testing FFT(complex<T>, complex<T>) ---- " << endl;
    141133  ffts.FFTForward(inc, outc);
    142   cout << " FourierCoef , NElts= " << outc.NElts() << endl;
    143   outc.Print(0,0,nprtfc,0,nprtfc);
     134  cout << " FourierCoef , NElts= " << outc.NElts() << outc << endl;
    144135
    145136  ffts.FFTBackward(outc, bkc);
    146   cout << " Backward , NElts= " << bkc.NElts() << endl;
    147   bkc.Print(0,0,nprt,0,nprt);
     137  cout << " Backward , NElts= " << bkc.NElts() << bkc << endl;
    148138 
    149139  difc = bkc*complex<T>(fact,0.) - inc;
    150   cout << " Difference , NElts= " << difc.NElts() << endl;
    151   difc.Print(0,0,nprt,0,nprt);
     140  cout << " Difference , NElts= " << difc.NElts() << difc << endl;
    152141
    153142  ndiff = 0;
     
    173162
    174163  if (narg < 4) {
    175     cout << "tfft/ args error - \n  Usage tfft size px/Px/Mx/Wx f/d [NPrtFC NPrt] \n"
     164    cout << "tfft/ args error - \n  Usage tfft size px/Px/Mx/Wx f/d [NPrt=50 PrtLev=0] \n"
    176165         << " p=FFTPackTest  P=FFTPack, M=FFTMayer, W= FFTWServer"
    177166         << " x=0 -> Random input - f=float, d=double " << endl;
     
    188177
    189178  int sz = atoi(arg[1]);
    190   if (narg > 4) nprtfc = atoi(arg[4]);
    191   if (narg > 5) nprt = atoi(arg[4]);
     179  int nprt = 50;
     180  int prtlev = 0;
     181  if (narg > 4) nprt = atoi(arg[4]);
     182  if (narg > 5) prtlev = atoi(arg[5]);
     183  BaseArray::SetMaxPrint(nprt, prtlev);
    192184
    193185  if (sz < 2) sz = 2;
Note: See TracChangeset for help on using the changeset viewer.