25#include<gsl/gsl_dht.h>
49 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
62 dht(
size_t size,
double nu,
double xmax ){
65 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
79 explicit dht( gsl_dht* v ){
116#ifdef __GXX_EXPERIMENTAL_CXX0X__
122 std::swap(
count, v.count );
123 v.ccgsl_pointer =
nullptr;
131 dht( std::move( v ) ).swap( *
this );
241#ifdef __GXX_EXPERIMENTAL_CXX0X__
252 int init(
double nu,
double xmax ){
return gsl_dht_init(
get(), nu, xmax ); }
275 int apply(
double* f_in,
double* f_out )
const {
276 return gsl_dht_apply(
get(), f_in, f_out ); }
286 template<
typename ARRAY>
287 int apply( ARRAY& f_in, ARRAY& f_out )
const {
288 size_t n =
get()->size;
289 if( f_in.size() !=
n )
290 throw std::length_error(
"gsl::dht::apply(): f_in must have same size as *this.");
291 if( f_out.size() !=
n )
292 throw std::length_error(
"gsl::dht::apply(): f_out must have same size as *this.");
293 return gsl_dht_apply(
get(), f_in.data(), f_out.data() ); }
Discrete Hankel Transforms.
bool operator>=(dht const &v) const
A container needs to define an ordering for sorting.
void swap(dht &v)
Swap two dht objects.
int apply(ARRAY &f_in, ARRAY &f_out) const
C++ version of gsl_dht_apply().
dht(dht &&v)
Move constructor.
bool empty() const
Find if the dht is empty.
double x_sample(int n) const
C++ version of gsl_dht_x_sample().
int init(double nu, double xmax)
C++ version of gsl_dht_init().
dht()
The default constructor is only really useful for assigning to.
dht(size_t size, double nu, double xmax)
C++ version of gsl_dht_new().
dht(gsl_dht *v)
Could construct from a gsl_dht.
dht & operator=(dht &&v)
Move operator.
bool unique() const
Find if this is the only object sharing the gsl_dht.
bool operator==(dht const &v) const
Two dht are identically equal if their elements are identical.
dht & operator=(dht const &v)
The assignment operator.
bool operator>(dht const &v) const
A container needs to define an ordering for sorting.
bool operator<=(dht const &v) const
A container needs to define an ordering for sorting.
dht(dht const &v)
The copy constructor.
int apply(double *f_in, double *f_out) const
C++ version of gsl_dht_apply().
gsl_dht * get() const
Get the gsl_dht.
double k_sample(int n) const
C++ version of gsl_dht_k_sample().
~dht()
The destructor only deletes the pointers if count reaches zero.
gsl_dht * ccgsl_pointer
The shared pointer.
size_t * count
The shared reference count.
dht(size_t const size)
The default constructor creates a new dht with n elements.
size_t use_count() const
Find how many dht objects share this pointer.
bool operator<(dht const &v) const
A container needs to define an ordering for sorting.
bool operator!=(dht const &v) const
Two dht are different if their elements are not identical.
size_t size(series const &cs)
C++ version of gsl_cheb_size().
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++.