|
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 54 of file logInterpolator.hpp.
#include <math/logInterpolator.hpp>
Public Member Functions | |
| logInterpolator () | |
| Default constructor. | |
| logInterpolator (const std::vector< realT > &x, const std::vector< realT > &y) | |
| Convert the inputs to their log10 values, and construct the interpolator. | |
| void | setup (const std::vector< realT > &x, const std::vector< realT > &y) |
| Convert the inputs to their log10 values, and construct the interpolator. | |
| realT | operator() (const realT &x) |
| Calculate the interpolated value at the input. | |
Protected Attributes | |
| gslInterpolator< interpT > | m_interp |
| The interpolator. | |
| std::vector< realT > | m_logx |
| Internal storage of the log10 values of the x values. | |
| std::vector< realT > | m_logy |
| Internal storage of the lgo10 values of the y values. | |
|
inline |
Default constructor.
Definition at line 68 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 76 of file logInterpolator.hpp.
References setup().
|
inline |
Calculate the interpolated value at the input.
Definition at line 123 of file logInterpolator.hpp.
References 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 88 of file logInterpolator.hpp.
References mx::invalidarg, m_interp, m_logx, m_logy, and mx::sizeerr.
Referenced by logInterpolator().
|
protected |
The interpolator.
Definition at line 61 of file logInterpolator.hpp.
Referenced by operator()(), and setup().
|
protected |
Internal storage of the log10 values of the x values.
Definition at line 63 of file logInterpolator.hpp.
Referenced by setup().
|
protected |
Internal storage of the lgo10 values of the y values.
Definition at line 64 of file logInterpolator.hpp.
Referenced by setup().