/* ------------------ apc.icc ------------------- Example illustrating C programming for performing operations comparable to those performed in apcxx.icc R. Ansari 08/2001 ---- Computation steps : > Allocate an array representing a matrix (NL x NC ) (mtx) > fill it with a gaussian distributed random values > make a copy of the matrix (mtxs) > allocate and fill 1D filter in Fourier space > Loop over matrix rows k >> Extract row k (fline) >> compute 1D Fourier transform FFTForward (fline) >> apply filter in Fourier space >> compute backward 1D FFT >> Replace matrix row with the filtered values > free the allocated memory this example code can be - included in a main program - executed using runcxx csh> runcxx -tmpdir /tmp -f apc.icc - executed within spiapp Cmd> c++execfrf apc.icc */ // Select computation on float or double (r_4 r_8) #define FTYP r_4 // Number of matrix lines and colums int NL = 1024; int NC = 4096; int i,k; cout << " apc : NL= " << NL << " NC= " << NC << endl; PrtTim("apc_Start"); // Creation of the initial matrix FTYP * mtx = new FTYP [NL*NC]; // Filling matrix with gaussian random values for(i=0; i