Skip to content
Snippets Groups Projects
Commit aec0d620 authored by Chichi Lalescu's avatar Chichi Lalescu
Browse files

add fftw transpose plan

parent 3b16beb6
Branches
Tags
No related merge requests found
...@@ -148,3 +148,27 @@ int fftwf_get_descriptors_3D( ...@@ -148,3 +148,27 @@ int fftwf_get_descriptors_3D(
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
/* the following is copied from
* http://agentzlerich.blogspot.com/2010/01/using-fftw-for-in-place-matrix.html
* */
fftwf_plan plan_transpose(
int rows,
int cols,
float *in,
float *out,
const unsigned flags)
{
fftwf_iodim howmany_dims[2];
howmany_dims[0].n = rows;
howmany_dims[0].is = cols;
howmany_dims[0].os = 1;
howmany_dims[1].n = cols;
howmany_dims[1].is = 1;
howmany_dims[1].os = rows;
const int howmany_rank = sizeof(howmany_dims)/sizeof(howmany_dims[0]);
return fftw_plan_guru_r2r(/*rank*/0, /*dims*/NULL,
howmany_rank, howmany_dims,
in, out, /*kind*/NULL, flags);
}
...@@ -34,5 +34,12 @@ int fftwf_get_descriptors_3D( ...@@ -34,5 +34,12 @@ int fftwf_get_descriptors_3D(
field_descriptor **fr, field_descriptor **fr,
field_descriptor **fc); field_descriptor **fc);
fftwf_plan plan_transpose(
int rows,
int cols,
float *in,
float *out,
const unsigned flags = FFTW_ESTIMATE);
#endif//FFTWF_TOOLS #endif//FFTWF_TOOLS
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment