mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Interpolate a function in log space.
Given a discrete function, conduct linear interpolation in log space. The input vectors are converted to their log10 values. Linear interpolation using gslInterpolator is conducted on the log10 of the input value. The output is converted back. So the result is
Definition at line 49 of file logInterpolator.hpp.
#include <math/logInterpolator.hpp>
Public Member Functions | |
logInterpolator () | |
Default constructor. More... | |
logInterpolator (const std::vector< realT > &x, const std::vector< realT > &y) | |
Convert the inputs to their log10 values, and construct the interpolator. More... | |
void | setup (const std::vector< realT > &x, const std::vector< realT > &y) |
Convert the inputs to their log10 values, and construct the interpolator. More... | |
realT | operator() (const realT &x) |
Calculate the interpolated value at the input. More... | |
Protected Attributes | |
gslInterpolator< gsl_interp_linear< realT > > | m_interp |
The interpolator. More... | |
std::vector< realT > | m_logx |
Internal storage of the log10 values of the x values. More... | |
std::vector< realT > | m_logy |
Internal storage of the lgo10 values of the y values. More... | |
|
inline |
Default constructor.
Definition at line 60 of file logInterpolator.hpp.
|
inline |
Convert the inputs to their log10 values, and construct the interpolator.
mxException | if vectors are not the same size. |
[in] | y | the input x-axis [in] the input y-axis |
Definition at line 66 of file logInterpolator.hpp.
References mx::math::logInterpolator< realT >::setup().
|
inline |
Calculate the interpolated value at the input.
Definition at line 115 of file logInterpolator.hpp.
References mx::math::logInterpolator< realT >::m_interp.
|
inline |
Convert the inputs to their log10 values, and construct the interpolator.
mx::err::sizeerr | if vectors are not the same size. |
mx::err::invalidarg | if any of the values are <= 0 |
[in] | y | the input x-axis [in] the input y-axis |
Definition at line 78 of file logInterpolator.hpp.
References mx::math::logInterpolator< realT >::m_interp, mx::math::logInterpolator< realT >::m_logx, and mx::math::logInterpolator< realT >::m_logy.
Referenced by mx::math::logInterpolator< realT >::logInterpolator().
|
protected |
The interpolator.
Definition at line 53 of file logInterpolator.hpp.
Referenced by mx::math::logInterpolator< realT >::operator()(), and mx::math::logInterpolator< realT >::setup().
|
protected |
Internal storage of the log10 values of the x values.
Definition at line 55 of file logInterpolator.hpp.
Referenced by mx::math::logInterpolator< realT >::setup().
|
protected |
Internal storage of the lgo10 values of the y values.
Definition at line 56 of file logInterpolator.hpp.
Referenced by mx::math::logInterpolator< realT >::setup().