20#ifndef CCGSL_FFT_HALFCOMPLEX_FLOAT_HPP
21#define CCGSL_FFT_HALFCOMPLEX_FLOAT_HPP
23#include <gsl/gsl_fft_halfcomplex_float.h>
33 namespace halfcomplex_float {
45 inline int backward(
float data[],
size_t const stride,
size_t const n ){
46 return gsl_fft_halfcomplex_float_radix2_backward( data, stride,
n ); }
55 inline int inverse(
float data[],
size_t const stride,
size_t const n ){
56 return gsl_fft_halfcomplex_float_radix2_inverse( data, stride,
n ); }
64 inline int backward(
float data[],
size_t const n ){
65 return gsl_fft_halfcomplex_float_radix2_backward( data, 1,
n ); }
73 inline int inverse(
float data[],
size_t const n ){
74 return gsl_fft_halfcomplex_float_radix2_inverse( data, 1,
n ); }
83 template<
typename DATA>
84 inline int backward( DATA& data,
size_t const stride = 1 ){
85 return gsl_fft_halfcomplex_float_radix2_backward( data.data(), stride, data.size() / stride ); }
94 template<
typename DATA>
95 inline int inverse( DATA& data,
size_t const stride = 1 ){
96 return gsl_fft_halfcomplex_float_radix2_inverse( data.data(), stride, data.size() / stride ); }
120 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
133 explicit wavetable( gsl_fft_halfcomplex_wavetable_float* v ){
170#ifdef __GXX_EXPERIMENTAL_CXX0X__
176 std::swap(
count, v.count );
177 v.ccgsl_pointer =
nullptr;
185 wavetable( std::move( v ) ).swap( *
this );
295#ifdef __GXX_EXPERIMENTAL_CXX0X__
312 return gsl_fft_halfcomplex_float_backward( data, stride,
n,
wavetable.
get(), work.
get() ); }
325 return gsl_fft_halfcomplex_float_inverse( data, stride,
n,
wavetable.
get(), work.
get() ); }
335 inline int unpack(
float const real_coefficient[],
float complex_coefficient[],
336 size_t const stride,
size_t const n ){
337 return gsl_fft_halfcomplex_float_unpack( real_coefficient, complex_coefficient, stride,
n ); }
348 template<
typename DATA>
351 return gsl_fft_halfcomplex_float_backward( data.data(), stride, data.size(),
363 template<
typename DATA>
366 return gsl_fft_halfcomplex_float_inverse( data.data(), stride, data.size(),
377 template<
typename R,
typename C>
378 inline int unpack( R
const& real_coefficient, C& complex_coefficient,
size_t const stride ){
379 size_t n =
std::max( real_coefficient.size(), complex_coefficient.size() / 2);
380 return gsl_fft_halfcomplex_float_unpack( real_coefficient.data(), complex_coefficient.data(),
394 size_t const stride ){
396 return gsl_fft_halfcomplex_float_unpack( real_coefficient.
data(), complex_coefficient.
data(),
411 return gsl_fft_halfcomplex_float_backward( data, 1,
n,
wavetable.
get(), work.
get() ); }
423 return gsl_fft_halfcomplex_float_inverse( data, 1,
n,
wavetable.
get(), work.
get() ); }
432 inline int unpack(
float const real_coefficient[],
float complex_coefficient[],
size_t const n ){
433 return gsl_fft_halfcomplex_float_unpack( real_coefficient, complex_coefficient, 1,
n ); }
443 template<
typename DATA>
446 return gsl_fft_halfcomplex_float_backward( data.data(), 1, data.size(),
457 template<
typename DATA>
460 return gsl_fft_halfcomplex_float_inverse( data.data(), 1, data.size(),
470 template<
typename R,
typename C>
471 inline int unpack( R
const& real_coefficient, C& complex_coefficient ){
472 size_t n =
std::max( real_coefficient.size(), complex_coefficient.size() / 2);
473 return gsl_fft_halfcomplex_float_unpack( real_coefficient.data(), complex_coefficient.data(), 1,
n ); }
485 return gsl_fft_halfcomplex_float_unpack( real_coefficient.
data(), complex_coefficient.
data(), 1,
n ); }
C++ version of gsl_fft_halfcomplex_wavetable_float functions.
gsl_fft_halfcomplex_wavetable_float * get() const
Get the gsl_fft_halfcomplex_wavetable_float.
wavetable(size_t const n)
The default constructor creates a new workspace of size n.
wavetable(wavetable &&v)
Move constructor.
wavetable()
The default constructor is only really useful for assigning to.
bool empty() const
Find if the wavetable is empty.
void swap(wavetable &v)
Swap two wavetable.
gsl_fft_halfcomplex_wavetable_float * ccgsl_pointer
The shared pointer.
bool operator!=(wavetable const &v) const
Two wavetable are different equal if their elements are not identical.
wavetable & operator=(wavetable &&v)
Move operator.
bool operator>(wavetable const &v) const
A container needs to define an ordering for sorting.
size_t use_count() const
Find how many workspace objects share this pointer.
bool operator==(wavetable const &v) const
Two wavetable are identically equal if their elements are identical.
bool operator<=(wavetable const &v) const
A container needs to define an ordering for sorting.
~wavetable()
The destructor only deletes the pointers if count reaches zero.
size_t * count
The shared reference count.
wavetable(wavetable const &v)
The copy constructor.
bool operator<(wavetable const &v) const
A container needs to define an ordering for sorting.
bool unique() const
Find if this is the only object sharing the gsl_fft_halfcomplex_wavetable_float.
wavetable & operator=(wavetable const &v)
The assignment operator.
bool operator>=(wavetable const &v) const
A container needs to define an ordering for sorting.
wavetable(gsl_fft_halfcomplex_wavetable_float *v)
Could construct from a gsl_fft_halfcomplex_wavetable_float.
Workspace for real fast fourier transforms.
gsl_fft_real_workspace_float * get() const
Get the gsl_fft_real_workspace_float.
This class handles vector_complex_float objects as shared handles.
size_type size() const
The size (number of elements) of the vector_complex_float.
float * data()
Give access to the data block.
This class handles vector_float objects as shared handles.
size_type size() const
The size (number of elements) of the vector_float.
float * data()
Give access to the data block_float.
int backward(float data[], size_t const stride, size_t const n)
C++ version of gsl_fft_halfcomplex_float_radix2_backward().
int inverse(float data[], size_t const stride, size_t const n)
C++ version of gsl_fft_halfcomplex_float_radix2_inverse().
int inverse(gsl::complex_packed_array_float data, size_t const stride, size_t const n, wavetable const &wavetable, real_float::workspace &work)
C++ version of gsl_fft_halfcomplex_float_inverse().
int backward(gsl::complex_packed_array_float data, size_t const stride, size_t const n, wavetable const &wavetable, real_float::workspace &work)
C++ version of gsl_fft_halfcomplex_float_backward().
int unpack(float const real_coefficient[], float complex_coefficient[], size_t const stride, size_t const n)
C++ version of gsl_fft_halfcomplex_float_unpack().
int max(movstat::end_t const endtype, vector const &x, vector &y, workspace &w)
C++ version of gsl_movstat_max().
size_t n(workspace const &w)
C++ version of gsl_rstat_n().
The gsl package creates an interface to the GNU Scientific Library for C++.
gsl_complex_packed_array_float complex_packed_array_float
Typedef.