10 #ifndef CARMA_UTIL_FFTWALLOCATOR_H
11 #define CARMA_UTIL_FFTWALLOCATOR_H
36 typedef size_t size_type;
37 typedef ptrdiff_t difference_type;
39 typedef const T * const_pointer;
40 typedef T & reference;
41 typedef const T & const_reference;
51 pointer address ( reference value )
const {
55 const_pointer address( const_reference value )
const {
77 size_type max_size( )
const throw ( ) {
78 return std::numeric_limits<size_t>::max( ) /
sizeof( T );
82 pointer allocate( size_type num,
83 const void * hint = 0 ) {
85 return static_cast<pointer
>( ::fftw_malloc( num *
sizeof( T ) ) );
89 void construct( pointer p,
const T & value ) {
91 new (
static_cast<void *
>( p ) ) T( value );
95 void destroy( pointer p ) {
101 void deallocate( pointer p, size_type num ) {
103 fftw_free( static_cast<void *>( p ) );
109 template <
class T1,
class T2>
110 bool operator==(
const FftwAllocator<T1> &,
111 const FftwAllocator<T2> & ) throw ( ) {
115 template <
class T1,
class T2>
116 bool operator!=(
const FftwAllocator<T1> &,
117 const FftwAllocator<T2> & ) throw ( ) {
Allocator for memory for use by FFTW.
FftwAllocator()
Constructors and destructor.