The code performs a number (ITERS) of iterations of the
Bailey s 6-step FFT algorithm (following the ideas in the
CMU Task parallel suite).
1.- Generates an input signal vector (dgen) with size
n=n1xn2 stored in row major order
In this code the size of the input signal
is NN=NxN (n=NN, n1=n2=N)
2.- Transpose (tpose) A to have it stored in column
major order
3.- Perform independent FFTs on the rows (cffts)
4.- Scale each element of the resulting array by a
factor of w[n]**(p*q)
5.- Transpose (tpose) to prepair it for the next step
6.- Perform independent FFTs on the rows (cffts)
7.- Transpose the resulting matrix
The code requires nested Parallelism.
Kullanı lan bazı matlab bilgileri
Matlabda kodlar mfile lara yazı lı p kaydedilebilir. Ü st menüden, file, new, mfile. Command windowa yazdı kları nı zı kaydedemezsiniz. Yazdı ğ ı nı z kodu ç alı ş tı rabilmeniz iç in ç alı ş tı ğ ı nı z current directory nin altı na kaydetmelisiniz. Current directory i dosyanı n bulunduğ u yere de gö türebilirsiniz
#include <iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
long long n;
cin>>n;
if(n%2==1)
cout<<(n*n-1)/4<<endl;
else if (n%4==0)
cout <<(n*n)/4-1<<endl;
else{
if(n==2)
cout<<1<<endl;
else{
long long k=n/2-1;
cout <<k*k+2*k-3<<endl;
}
}
}
return 0;
}