Changeset 467 in Sophya for trunk/SophyaLib/NTools/fftserver.cc
- Timestamp:
- Oct 15, 1999, 2:05:15 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/fftserver.cc
r459 r467 23 23 sz_cfft = 0; 24 24 ws_cfft = NULL; 25 sz_cdfft = 0; 26 ws_cdfft = NULL; 25 27 } 26 28 … … 29 31 if (ws_rfft) delete[] ws_rfft; 30 32 if (ws_cfft) delete[] ws_cfft; 33 if (ws_cdfft) delete[] ws_cdfft; 31 34 } 32 35 … … 75 78 checkint_rfft(l); 76 79 rfftf_(&l, inout, ws_rfft); 80 for (int k= 2;k<=(l+1)/2;k++) inout[2*k-2]=-inout[2*k-2]; 77 81 } 78 82 … … 81 85 checkint_dfft(l); 82 86 dfftf_(&l, inout, ws_dfft); 87 for (int k= 2;k<=(l+1)/2;k++) inout[2*k-2]=-inout[2*k-2]; 83 88 } 84 89 … … 92 97 } 93 98 cfftf_(&l, foo, ws_cfft); 94 for (int i=0;i<l;i++) inout[i]= complex<float> (foo[2*i], foo[2*i+1]); 99 inout[0]=complex<float> (foo[0],foo[1]); 100 for (int i=1;i<l;i++) inout[l-i]= complex<float> (foo[2*i], foo[2*i+1]); 95 101 delete[] foo; 96 102 } … … 99 105 { 100 106 checkint_cdfft(l); 101 double* foo =new double[2*l];107 double* foo=new double[2*l]; 102 108 for (int i=0;i<l;i++){ 103 109 foo[2*i]=inout[i].real(); … … 105 111 } 106 112 cdfftf_(&l, foo, ws_cdfft); 107 for (int i=0;i<l;i++) inout[i]= complex<double> (foo[2*i],foo[2*i+1]); 113 inout[0]=complex<double> (foo[0],foo[1]); 114 for (int i=1;i<l;i++) { 115 inout[l-i]= complex<double> (foo[2*i],foo[2*i+1]); 116 } 108 117 delete[] foo; 109 118 } … … 112 121 { 113 122 checkint_rfft(l); 114 rfft b_(&l, inout, ws_rfft);123 rfftf_(&l, inout, ws_rfft); 115 124 } 116 125 … … 118 127 { 119 128 checkint_dfft(l); 120 dfft b_(&l, inout, ws_dfft);129 dfftf_(&l, inout, ws_dfft); 121 130 } 122 131 … … 129 138 foo[2*i+1]=inout[i].imag(); 130 139 } 131 cfft b_(&l, foo, ws_cfft);140 cfftf_(&l, foo, ws_cfft); 132 141 for (int i=0;i<l;i++) inout[i]=complex<float> (foo[2*i],foo[2*i+1]); 133 142 delete[] foo; … … 142 151 foo[2*i+1]=inout[i].imag(); 143 152 } 144 cdfft b_(&l, foo, ws_cdfft);153 cdfftf_(&l, foo, ws_cdfft); 145 154 for (int i=0;i<l;i++) inout[i]=complex<double> (foo[2*i],foo[2*i+1]); 146 155 delete[] foo;
Note:
See TracChangeset
for help on using the changeset viewer.