11 #define MAX(x,y) ( ( (x)<(y) )?(y):(x) )
22 static int prod(
const int *dims,
int ndims)
35 size_t nr=0 , nd=0,ntmp=0;
36 int dimReal = dims[ndims-1];
37 int dimOther =
prod(dims,ndims-1);
50 ptr = (
char*) malloc(memneeded);
52 if (*lenmem >= memneeded)
60 memset( st , 0 , memneeded);
79 int nrbins = dimReal/2+1;
87 for (k1=0;k1<dimOther;++k1) {
89 for (k2=0;k2<nrbins;++k2)
90 tmp2[ k2*dimOther+k1 ] = tmp1[k2];
93 for (k2=0;k2<nrbins;++k2) {
95 for (k1=0;k1<dimOther;++k1)
96 freqdata[ k1*(nrbins) + k2] = tmp1[k1];
105 int nrbins = dimReal/2+1;
109 for (k2=0;k2<nrbins;++k2) {
110 for (k1=0;k1<dimOther;++k1)
111 tmp1[k1] = freqdata[ k1*(nrbins) + k2 ];
115 for (k1=0;k1<dimOther;++k1) {
116 for (k2=0;k2<nrbins;++k2)
117 tmp1[k2] = tmp2[ k2*dimOther+k1 ];