mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Class to manage interpolation using the GSL interpolation library.
interpT | is the interpolation type, which also specifies the floating point precision. |
Definition at line 81 of file gslInterpolator.hpp.
#include <math/gslInterpolator.hpp>
Public Member Functions | |
gslInterpolator () | |
Default constructor. More... | |
gslInterpolator (realT *xin, realT *yin, size_t Nin) | |
Raw pointer constructor More... | |
gslInterpolator (std::vector< realT > &xin, std::vector< realT > &yin) | |
Vector constructor. More... | |
~gslInterpolator () | |
Destructor. More... | |
void | setup (realT *xin, realT *yin, size_t Nin) |
Setup the interpolator for the supplied data pointers. More... | |
void | setup (std::vector< realT > &xin, std::vector< realT > &yin) |
Setup the interpolator for the supplied data vectors. More... | |
realT | operator() (const realT &x) |
Calculate the interpolated function value at a point. More... | |
Protected Attributes | |
gsl_interp * | m_interp {nullptr} |
the gsl interpolator structure More... | |
gsl_interp_accel * | m_acc {nullptr} |
the gsl interpolation accelerator structure More... | |
realT * | m_xin |
the input x data More... | |
realT * | m_yin |
the input y data More... | |
mx::math::gslInterpolator< interpT >::gslInterpolator |
Default constructor.
Definition at line 146 of file gslInterpolator.hpp.
mx::math::gslInterpolator< interpT >::gslInterpolator | ( | realT * | xin, |
realT * | yin, | ||
size_t | Nin | ||
) |
Raw pointer constructor
[in] | xin | the input x data, this pointer is stored and must remain valid |
[in] | yin | the input y data, this pointer is stored and must remain valid |
[in] | Nin | the size of data vectors |
Definition at line 151 of file gslInterpolator.hpp.
mx::math::gslInterpolator< interpT >::gslInterpolator | ( | std::vector< realT > & | xin, |
std::vector< realT > & | yin | ||
) |
Vector constructor.
[in] | xin | the input x data, the pointer to xin.data() is stored and xin must remain unchanged |
[in] | yin | the input y data, the pointer to yin.data() is stored and yin must remain unchanged |
Definition at line 160 of file gslInterpolator.hpp.
mx::math::gslInterpolator< interpT >::~gslInterpolator |
interpT::realT mx::math::gslInterpolator< interpT >::operator() | ( | const realT & | x | ) |
Calculate the interpolated function value at a point.
x
[in] | x | the point at which to interpolate |
Definition at line 219 of file gslInterpolator.hpp.
void mx::math::gslInterpolator< interpT >::setup | ( | realT * | xin, |
realT * | yin, | ||
size_t | Nin | ||
) |
Setup the interpolator for the supplied data pointers.
mx::err::allocerr | if allocation fails |
mx::err::liberr | if GSL initialization fails |
[in] | xin | the input x data, this pointer is stored and must remain valid |
[in] | yin | the input y data, this pointer is stored and must remain valid |
[in] | Nin | the size of data vectors |
Definition at line 175 of file gslInterpolator.hpp.
void mx::math::gslInterpolator< interpT >::setup | ( | std::vector< realT > & | xin, |
std::vector< realT > & | yin | ||
) |
Setup the interpolator for the supplied data vectors.
mx::err::sizeerr | if the vectors are not the same size |
mx::err::allocerr | if allocation fails |
mx::err::liberr | if GSL initialization fails |
[in] | xin | the input x data, the pointer to xin.data() is stored and xin must remain unchanged |
[in] | yin | the input y data, the pointer to yin.data() is stored and yin must remain unchanged |
Definition at line 207 of file gslInterpolator.hpp.
|
protected |
the gsl interpolation accelerator structure
Definition at line 91 of file gslInterpolator.hpp.
|
protected |
the gsl interpolator structure
Definition at line 90 of file gslInterpolator.hpp.
|
protected |
the input x data
Definition at line 93 of file gslInterpolator.hpp.
|
protected |
the input y data
Definition at line 94 of file gslInterpolator.hpp.