mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches

Various tools for interpolating data and discrete functions.

Classes

struct  mx::math::gsl_interp_linear< _realT >
 GSL Linear Interpolation. More...
struct  mx::math::gsl_interp_steffen< _realT >
 GSL Steffen Interpolation. More...
class  mx::math::gslInterpolator< interpT >
 Class to manage interpolation using the GSL interpolation library. More...
class  mx::math::logInterpolator< interpT >
 Interpolate a function in log space. More...

Topics

 Image Transforms

Functions

template<typename realT>
int mx::math::gsl_interpolate (const gsl_interp_type *interpT, realT *xin, realT *yin, size_t Nin, realT *xout, realT *yout, size_t Nout)
 Interpolate a 1-D data X vs Y discrete function onto a new X axis.
template<typename realT>
int mx::math::gsl_interpolate (const gsl_interp_type *interpT, std::vector< realT > &xin, std::vector< realT > &yin, std::vector< realT > &xout, std::vector< realT > &yout)
 Interpolate a 1-D data X vs Y discrete function onto a new X axis (vector version).

Function Documentation

◆ gsl_interpolate() [1/2]

template<typename realT>
int mx::math::gsl_interpolate ( const gsl_interp_type * interpT,
realT * xin,
realT * yin,
size_t Nin,
realT * xout,
realT * yout,
size_t Nout )

Interpolate a 1-D data X vs Y discrete function onto a new X axis.

Parameters
interpTone of the gsl interpolation types.
[in]xinthe input x-axis
[in]yinthe input y-values
[in]Ninthe size of the input x-y data series
[in]xoutthe desired x-axis
[out]youtthe output interpolated y-values, pre-allocated
[in]Noutthe size of the output x-y axis
Returns
0 on success
-1 on a gsl error.
Todo
report errors iaw mxlib standard in gsl_interpolate

Definition at line 59 of file gslInterpolation.hpp.

Referenced by gsl_interpolate(), and mx::astro::astroSpectrum< _spectrumT, freq, verboseT >::setSpectrum().

◆ gsl_interpolate() [2/2]

template<typename realT>
int mx::math::gsl_interpolate ( const gsl_interp_type * interpT,
std::vector< realT > & xin,
std::vector< realT > & yin,
std::vector< realT > & xout,
std::vector< realT > & yout )

Interpolate a 1-D data X vs Y discrete function onto a new X axis (vector version).

Parameters
interpTof the gsl interpolation types.
[in]xinthe input x-axis
[in]yinthe input y-values
[in]xoutthe desired x-axis
[out]youtthe output interpolated y-values, does not need to be allocated
Returns
0 on success or -1 if GSL reports an interpolation error.

Definition at line 120 of file gslInterpolation.hpp.

References gsl_interpolate().