26 #include <boost/format.hpp>
58 for (
size_t i = 0; i <
N; i++) {
59 in[i][0] = cos(3.0 * 2.0 *
Units::pi *
static_cast<double>(i) /
static_cast<double>(
N));
64 p = fftw_plan_dft_1d(
N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
66 for (
size_t i = 0; i <
N; i++) {
67 log.info() << boost::format(
"freq: %3d %+9.5f %+9.5f I") % i % out[i][0] % out[i][1];
72 printf(
"\nInverse transform:\n");
73 q = fftw_plan_dft_1d(
N, out, in2, FFTW_BACKWARD, FFTW_ESTIMATE);
76 for (
size_t i = 0; i <
N; i++) {
80 for (
size_t i = 0; i <
N; i++) {
81 log.info() << boost::format(
"recover: %3d %+9.5f %+9.5f I vs. %+9.5f %+9.5f I") % i % in[i][0] % in[i][1] %
82 in2[i][0] % in2[i][1];
88 log.info() <<
"This is the end of the test";