00001 00005 /* 00006 * Author: Pawel A.Penczek, 09/09/2006 (Pawel.A.Penczek@uth.tmc.edu) 00007 * Copyright (c) 2000-2006 The University of Texas - Houston Medical School 00008 * 00009 * This software is issued under a joint BSD/GNU license. You may use the 00010 * source code in this file under either license. However, note that the 00011 * complete EMAN2 and SPARX software packages have some GPL dependencies, 00012 * so you are responsible for compliance with the licenses of these packages 00013 * if you opt to use BSD licensing. The warranty disclaimer below holds 00014 * in either instance. 00015 * 00016 * This complete copyright notice must be included in any revised version of the 00017 * source code. Additional authorship citations may be added, but existing 00018 * author citations must be preserved. 00019 * 00020 * This program is free software; you can redistribute it and/or modify 00021 * it under the terms of the GNU General Public License as published by 00022 * the Free Software Foundation; either version 2 of the License, or 00023 * (at your option) any later version. 00024 * 00025 * This program is distributed in the hope that it will be useful, 00026 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00027 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00028 * GNU General Public License for more details. 00029 * 00030 * You should have received a copy of the GNU General Public License 00031 * along with this program; if not, write to the Free Software 00032 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00033 * 00034 */ 00035 00036 #ifndef eman_native_fft_h__ 00037 #define eman_native_fft_h__ 00038 00039 #ifdef NATIVE_FFT 00040 00041 namespace EMAN 00042 { 00043 class Nativefft 00044 { 00045 public: 00064 //----------2D FFT INPLACE--------------------------- 00065 // 1d inplace FFT 00066 static int fmrs_1rf(float *x, float *work, int nsam); 00067 00068 // 1d inplace IFFT 00069 static int fmrs_1rb(float *x, float *work, int nsam); 00070 00071 //----------2D FFT INPLACE--------------------------- 00072 // 2d inplace fft 00073 static int fmrs_2rf(float *x, float *work, int lda, int nsam, int nrow); 00074 00075 // 2d inplace IFFT 00076 static int fmrs_2rb(float *y, float *work, int lda, int nsam, int nrow); 00077 00078 //---------------3D INPLACE FFT---------------------- 00079 // 3d inplace FFT 00080 static int fmrs_3rf(float *b, float *work, int lda, int nsam, int nrow, int nslice); 00081 00082 // 3d inplace IFFT 00083 static int fmrs_3rb(float *b, float *work, int lda, int nsam, int nrow, int nslice); 00084 00085 // 2D FFT OUT OF PLACE 00086 static int ftp_2rf(float *reald, float *complexd, int lda, int nsam, int nrow); 00087 00088 // 2D IFT This one is part of out of place, but overwrites the input by the real image (not resized!).... 00089 static int ftp_2rb(float *complexd, int lda, int nsam, int nrow); 00090 00091 // 3D FFT OUT OF PLACE 00092 static int ftp_3rf(float *reald, float *complexd, int lda, int nsam, int nrow, int nslice); 00093 00094 // 3D IFT This one is part of out of place, but overwrites the input by the real image (not resized!).... 00095 static int ftp_3rb(float *complexd, int lda, int nsam, int nrow, int nslice); 00096 00097 00098 private: 00099 /* chao modify integer to int */ 00100 typedef int integer; 00101 00102 static int fftmcf_(float *a, float *b, integer *ntot, integer *n, integer *nspan, integer *isn); 00103 }; 00104 00105 00106 00107 //#define __cplusplus 00108 //#ifdef __cplusplus 00109 //extern "C" { 00110 //#endif 00111 00112 //#define DOUBLE 00113 00114 #ifdef DOUBLE 00115 #define Treal double 00116 #else 00117 #define Treal float 00118 #endif 00119 00120 void cfftf(int N, Treal data[], Treal wrk[]); 00121 void cfftb(int N, Treal data[], Treal wrk[]); 00122 void cffti(int N, Treal wrk[]); 00123 00124 void rfftf(int N, Treal data[], Treal wrk[]); 00125 void rfftb(int N, Treal data[], Treal wrk[]); 00126 void rffti(int N, Treal wrk[]); 00127 00128 //#ifdef __cplusplus 00129 //} 00130 #//endif 00131 00132 00133 00134 } 00135 00136 #endif //NATIVE_FFT 00137 00138 #endif //eman_native_fft_h__