Changeset 717 in Sophya for trunk/SophyaLib/NTools/fftservintf.cc


Ignore:
Timestamp:
Feb 5, 2000, 6:22:55 PM (26 years ago)
Author:
ansari
Message:

Introduction FFTMayer, debug de FFTPack - Reza 5/2/2000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/NTools/fftservintf.cc

    r710 r717  
    77{
    88  _info = info;
    9   _fgnorm = false;
     9  _fgnorm = true;
    1010}
    1111
     
    115115
    116116
    117 // Methodes pour reordonner les donnees
    118 
    119 /* --Methode-- */
    120 void FFTServerInterface::ReShapetoReal( TVector< complex<r_8> > const & in, TVector< r_8 >  & out)
    121 {
    122   int N = in.NElts();
    123   out.ReSize(in.NElts()*2);
    124   out(0) = in(0).real();
    125   if (in(in.NElts()-1).imag() == 0)  {
    126     for(int i=1; i<in.NElts(); i++)
    127       out(i) = in(i).real();
    128 
    129     for(int i=1; i<in.NElts(); i++)
    130       out(i+in.NElts()-1) = in(in.NElts()-i-1).imag();
    131 
    132   }
    133   else    {
    134     for(int i=1; i<in.NElts(); i++)
    135       out(i) = in(i).real();
    136     for(int i=1; i<in.NElts(); i++)
    137       out(i+in.NElts()-1) = in(in.NElts()-i).imag();
    138   }
    139 }
    140 /* --Methode-- */
    141 void FFTServerInterface::ReShapetoReal( TVector< complex<r_4> > const & in, TVector< r_4 >  & out)
    142 {
    143   int N = in.NElts();
    144   out.ReSize(in.NElts()*2);
    145   out(0) = in(0).real();
    146   if (in(in.NElts()-1).imag() == 0)  {
    147     for(int i=1; i<in.NElts(); i++)
    148       out(i) = in(i).real();
    149 
    150     for(int i=1; i<in.NElts(); i++)
    151       out(i+in.NElts()-1) = in(in.NElts()-i-1).imag();
    152 
    153   }
    154   else    {
    155     for(int i=1; i<in.NElts(); i++)
    156       out(i) = in(i).real();
    157     for(int i=1; i<in.NElts(); i++)
    158       out(i+in.NElts()-1) = in(in.NElts()-i).imag();
    159   }
    160 }
    161 
    162 
    163 /* --Methode-- */
    164 void FFTServerInterface::ReShapetoCompl(TVector< r_8 > const & in, TVector< complex<r_8> > & out)
    165 {
    166   int N = in.NElts();
    167   out.ReSize(N/2+1);
    168   out(0) = complex<r_8> (in(0),0.);
    169 
    170   if(in.NElts()%2 !=0) {
    171     for(int k=1;k<=N/2+1;k++) {
    172       out(k) =  complex<r_8> (in(k),in(N-k));
    173     }
    174   }
    175   else  {
    176     for(int k=1;k<N/2;k++)  {
    177       out(k) =  complex<r_8> (in(k),in(N-k));
    178     }
    179     out(N/2) = complex<r_8> (in(N/2),0.);
    180   }
    181 
    182 }
    183 
    184 /* --Methode-- */
    185 void FFTServerInterface::ReShapetoCompl(TVector< r_4 > const & in, TVector< complex<r_4> > & out)
    186 {
    187   int N = in.NElts();
    188   out.ReSize(N/2+1);
    189   out(0) = complex<r_4> (in(0),0.);
    190 
    191   if(in.NElts()%2 !=0) {
    192     for(int k=1;k<=N/2+1;k++) {
    193       out(k) =  complex<r_4> (in(k),in(N-k));
    194     }
    195   }
    196   else  {
    197     for(int k=1;k<N/2;k++)  {
    198       out(k) =  complex<r_4> (in(k),in(N-k));
    199     }
    200     out(N/2) = complex<r_4> (in(N/2),0.);
    201   }
    202 
    203 }
    204 
Note: See TracChangeset for help on using the changeset viewer.