sven
07-14-2006, 09:41 AM
I have the following problem:
If I do an inverse fourier transform on a set of data rhok[1][N2][N3] and rhokspeq[1][2*N2] I get the correct result. But if I afterwards re-initialize rhok and rhokspeq with the original data and do the inverse fourier transform again, I get sth. different. The arrays run from 1..N2, 1..N3 (rhok) and from 1..2*N2(rohkspeq) by definition. All these values are replaced after the first inverse transform. Still, it seems I missed to reset sth?
double ***rhok, **rhokspeq;
rhok = f3tensor(1,1,1,N2,1,N3); rhokspeq = matrix(1,1,1,2*N2);
for(i=1;i<=N2;i++) {
rhokspeq[1][i] = 0.; rhokspeq[1][2*i]= 0.;
for(j=1;j<=N3;j++)
rhok[1][i][j] = i*j; //just as an example
}
rlft3(rhok,rhokspeq,1,N2,N3,-1);
//... this is alright...
//reset rhok and rhokspeq:
for(i=1;i<=N2;i++) {
rhokspeq[1][i] = 0.; rhokspeq[1][2*i]= 0.;
for(j=1;j<=N3;j++)
rhok[1][i][j] = i*j; //just as an example
}
rlft3(rhok,rhokspeq,1,N2,N3,-1);
//...but this is now wrong!
For the Fourier transform ( rlft3(rhok,rhokspeq,1,N2,N3,1)) this problem does not occur. Thanks for any help.
Sven (teeffelen ( at ) thphy.uni-duesseldorf.de)
If I do an inverse fourier transform on a set of data rhok[1][N2][N3] and rhokspeq[1][2*N2] I get the correct result. But if I afterwards re-initialize rhok and rhokspeq with the original data and do the inverse fourier transform again, I get sth. different. The arrays run from 1..N2, 1..N3 (rhok) and from 1..2*N2(rohkspeq) by definition. All these values are replaced after the first inverse transform. Still, it seems I missed to reset sth?
double ***rhok, **rhokspeq;
rhok = f3tensor(1,1,1,N2,1,N3); rhokspeq = matrix(1,1,1,2*N2);
for(i=1;i<=N2;i++) {
rhokspeq[1][i] = 0.; rhokspeq[1][2*i]= 0.;
for(j=1;j<=N3;j++)
rhok[1][i][j] = i*j; //just as an example
}
rlft3(rhok,rhokspeq,1,N2,N3,-1);
//... this is alright...
//reset rhok and rhokspeq:
for(i=1;i<=N2;i++) {
rhokspeq[1][i] = 0.; rhokspeq[1][2*i]= 0.;
for(j=1;j<=N3;j++)
rhok[1][i][j] = i*j; //just as an example
}
rlft3(rhok,rhokspeq,1,N2,N3,-1);
//...but this is now wrong!
For the Fourier transform ( rlft3(rhok,rhokspeq,1,N2,N3,1)) this problem does not occur. Thanks for any help.
Sven (teeffelen ( at ) thphy.uni-duesseldorf.de)