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
g a w k或GNU awk是由Alfred V. A h o,Peter J.We i n b e rg e r和Brian W. K e r n i g h a n于1 9 7 7年為U N I X創(chuàng)建的a w k編程語言的較新版本之一。a w k出自創(chuàng)建者姓的首字母。a w k語言(在其所有的版本中)是一種具有很強(qiáng)能力的模式匹配和過程語言。a w k獲取一個(gè)文件(或多個(gè)文件)來查找匹配特定模式的記錄。當(dāng)查到匹配后,即執(zhí)行所指定的動作。作為一個(gè)程序員,你不必操心通過文件打開、循環(huán)讀每個(gè)記錄,控制文件的結(jié)束,或執(zhí)行完后關(guān)閉文件。
#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;
}