Audio Processing Framework (APF) version 0.5.0
Classes | Namespaces | Macros
fftwtools.h File Reference

Some tools for the use with the FFTW library. More...

#include <fftw3.h>
#include <utility>
#include <limits>

Go to the source code of this file.

Classes

struct  apf::fftw< T >
 Traits class to select float/double/long double versions of FFTW functions. More...
 
struct  apf::fftw< float >
  float specialization of the traits class fftw More...
 
struct  apf::fftw< double >
  double specialization of the traits class fftw More...
 
struct  apf::fftw< long double >
  long double specialization of the traits class fftw More...
 
struct  apf::fftw_allocator< T >
 

Namespaces

namespace  apf
 Audio Processing Framework.
 

Macros

#define APF_FFTW_TRAITS(longtype, shorttype)
 Macro to create traits classes for float/double/long double. More...
 

Detailed Description

Some tools for the use with the FFTW library.

Definition in file fftwtools.h.

Macro Definition Documentation

◆ APF_FFTW_TRAITS

#define APF_FFTW_TRAITS (   longtype,
  shorttype 
)
Value:
\ \
template<> \
struct fftw<longtype> { \
using plan = fftw ## shorttype ## plan; \
static void* malloc(size_t n) { return fftw ## shorttype ## malloc(n); } \
static void free(void* p) { fftw ## shorttype ## free(p); } \
static void destroy_plan(plan p) { \
fftw ## shorttype ## destroy_plan(p); p = nullptr; } \
static void execute(const plan p) { fftw ## shorttype ## execute(p); } \
static void execute_r2r(const plan p, longtype *in, longtype *out) { \
fftw ## shorttype ## execute_r2r(p, in, out); } \
static plan plan_r2r_1d(int n, longtype* in, longtype* out \
, fftw_r2r_kind kind, unsigned flags) { \
return fftw ## shorttype ## plan_r2r_1d(n, in, out, kind, flags); } \
class scoped_plan { \
public: \
template<typename Func, typename... Args> \
scoped_plan(Func func, Args... args) \
: _plan(func(std::forward<Args>(args)...)), _owning(true) {} \
scoped_plan(scoped_plan&& other) \
: _plan(std::move(other._plan)), _owning(true) { \
other._owning = false; } \
~scoped_plan() { if (_owning) destroy_plan(_plan); } \
operator const plan&() { return _plan; } \
private: \
plan _plan; bool _owning; }; \
};

Macro to create traits classes for float/double/long double.

Definition at line 47 of file fftwtools.h.