mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::math::fft::fftwEnvironment< realT, threads > Struct Template Reference

template<typename realT, bool threads = false>
struct mx::math::fft::fftwEnvironment< realT, threads >

Manage the FFTW environment and wisdom using RAII.

This class manages the FFTW environment. On construction, wisdom is imported from the mxlib standard location, and if threads are used threading is initialized and planners are made thread safe.

Note
the fftw docs recommend against using fftw_make_planner_thread_safe. It does seem to play poorly with omp.

On destruction, wisdom is exported and the fftw_cleanup[_threads] function is called.

Typically, an object of this type should be created in the main function. Nothing else needs to be done with it, as it will be destructed on program termination. Example:

#include <mx/fft/fftwEnvironment.hpp>
int main()
{
typedef double realT;
mx::fftwEnvironment<realT> fftwEnv;
//do stuff . . .
return 0;
}

Note that there is no need to explicitly destroy the object fftwEnv.

Definition at line 121 of file fftwEnvironment.hpp.

#include <math/fft/fftwEnvironment.hpp>

Public Member Functions

 fftwEnvironment (unsigned nThreads=0)
 Constructor. More...
 
 ~fftwEnvironment ()
 Destructor. More...
 

Constructor & Destructor Documentation

◆ fftwEnvironment()

template<typename realT , bool threads = false>
mx::math::fft::fftwEnvironment< realT, threads >::fftwEnvironment ( unsigned  nThreads = 0)
inlineexplicit

Constructor.

Parameters
[in]nThreads[optional] the number of threads to use. This can be changed any time by the program by calling fftw_plan_with_nthreads()

Definition at line 124 of file fftwEnvironment.hpp.

◆ ~fftwEnvironment()

template<typename realT , bool threads = false>
mx::math::fft::fftwEnvironment< realT, threads >::~fftwEnvironment ( )
inline

Destructor.

Definition at line 133 of file fftwEnvironment.hpp.


The documentation for this struct was generated from the following file: