root / synthbench / euroben-ports / base / C-MPI / mod2f / .svn / text-base / gendat.c.svn-base @ 0:839f52ef7657
History | View | Annotate | Download (793 Bytes)
1 |
#include <math.h> |
---|---|
2 |
#include "mpiargs.h" |
3 |
|
4 |
void gendat( int m, int n, double **ar, double **ai ) |
5 |
// --------------------------------------------------------------------- |
6 |
// --- Routine 'gendat' generates the test data for the FFT: |
7 |
// One complete cosine cycle in the Real part of the data. |
8 |
// Zero in the imaginary part of the data. |
9 |
// --------------------------------------------------------------------- |
10 |
{ |
11 |
int i, j, nbase, nr; |
12 |
double arg, fac; |
13 |
// --------------------------------------------------------------------- |
14 |
nr = m*nodes; |
15 |
fac = 8.0*atan( 1.0 )/(double)(n*nr); |
16 |
nbase = me*m*n; |
17 |
|
18 |
for( j = 0; j < m; j++ ) { |
19 |
for( i = 0; i < n; i++ ) { |
20 |
arg = ( i + nbase + j*n )*fac; |
21 |
ar[j][i] = cos( arg ); |
22 |
ai[j][i] = 0.0; |
23 |
} |
24 |
} |
25 |
} |