20#ifndef CCGSL_BSPLINE_HPP
21#define CCGSL_BSPLINE_HPP
23#include<gsl/gsl_bspline.h>
52 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
102#ifdef __GXX_EXPERIMENTAL_CXX0X__
108 std::swap(
count, v.count );
109 v.ccgsl_pointer =
nullptr;
117 workspace( std::move( v ) ).swap( *
this );
227#ifdef __GXX_EXPERIMENTAL_CXX0X__
271 return gsl_bspline_breakpoint( i, w.
get() ); }
280 return gsl_bspline_greville_abscissa( i, w.
get() ); }
289 return gsl_bspline_knots( breakpts.
get(), w.
get() ); }
299 return gsl_bspline_knots_uniform(
a,
b, w.
get() ); }
310 return gsl_bspline_eval( x, B.
get(), w.
get() ); }
323 size_t* iend, workspace& w ){
324 return gsl_bspline_eval_nonzero( x, Bk.
get(), istart, iend, w.get() ); }
337 return gsl_bspline_eval_nonzero( x, Bk.
get(), &istart, &iend, w.
get() ); }
349 return gsl_bspline_deriv_eval( x, nderiv, dB.
get(), w.
get() ); }
363 size_t* istart,
size_t* iend, workspace& w ){
364 return gsl_bspline_deriv_eval_nonzero( x, nderiv, dB.
get(), istart, iend, w.get() ); }
377 size_t& istart,
size_t& iend,
workspace& w ){
378 return gsl_bspline_deriv_eval_nonzero( x, nderiv, dB.
get(), &istart, &iend, w.
get() ); }
bool operator==(workspace const &v) const
Two workspace are identically equal if their elements are identical.
workspace(workspace &&v)
Move constructor.
bool operator>(workspace const &v) const
A container needs to define an ordering for sorting.
workspace()
The default constructor is only really useful for assigning to.
bool empty() const
Find if the workspace is empty.
gsl::vector knots()
Get the knots vector.
bool operator!=(workspace const &v) const
Two workspace are different if their elements are not identical.
size_t use_count() const
Find how many workspace objects share this pointer.
bool unique() const
Find if this is the only object sharing the gsl_bspline.
workspace & operator=(workspace const &v)
The assignment operator.
workspace(size_t const k, size_t const nbreak)
The default constructor creates a new workspace of order k for data with nbreak breakpoints.
~workspace()
The destructor only deletes the pointers if count reaches zero.
bool operator<=(workspace const &v) const
A container needs to define an ordering for sorting.
workspace(gsl_bspline_workspace *v)
Could construct from a gsl_bspline_workspace.
void swap(workspace &v)
Swap two workspace objects.
bool operator>=(workspace const &v) const
A container needs to define an ordering for sorting.
gsl_bspline_workspace * ccgsl_pointer
The shared pointer.
workspace(workspace const &v)
The copy constructor.
size_t * count
The shared reference count.
bool operator<(workspace const &v) const
A container needs to define an ordering for sorting.
workspace & operator=(workspace &&v)
Move operator.
gsl_bspline_workspace * get() const
Get the gsl_bspline_workspace.
This class handles matrix objects as shared handles.
gsl_matrix * get()
Get the gsl_matrix.
This class handles vector objects as shared handles.
gsl_vector * get()
Get the gsl_vector.
void wrap_gsl_vector_without_ownership(gsl_vector *v)
This function is intended mainly for internal use.
size_t ncoeffs(workspace &w)
C++ version of gsl_bspline_ncoeffs().
int knots_uniform(double const a, double const b, workspace &w)
C++ version of gsl_bspline_knots_uniform().
int eval(double const x, vector &B, workspace &w)
C++ version of gsl_bspline_eval().
size_t order(workspace &w)
C++ version of gsl_bspline_order().
double breakpoint(size_t i, workspace &w)
C++ version of gsl_bspline_breakpoint().
int knots(vector const &breakpts, workspace &w)
C++ version of gsl_bspline_knots().
int deriv_eval_nonzero(double const x, size_t const nderiv, matrix &dB, size_t &istart, size_t &iend, workspace &w)
C++ version of gsl_bspline_deriv_eval_nonzero().
int deriv_eval(double const x, size_t const nderiv, matrix &dB, workspace &w)
C++ version of gsl_bspline_deriv_eval().
size_t nbreak(workspace &w)
C++ version of gsl_bspline_nbreak().
int eval_nonzero(double const x, vector &Bk, size_t &istart, size_t &iend, workspace &w)
C++ version of gsl_bspline_eval_nonzero().
double greville_abscissa(size_t i, workspace &w)
C++ version of gsl_bspline_greville_abscissa().
double b(int order, double qq)
C++ version of gsl_sf_mathieu_b().
double a(int order, double qq)
C++ version of gsl_sf_mathieu_a().
The gsl package creates an interface to the GNU Scientific Library for C++.