29 #include "../mxException.hpp"
48 template<
typename realT>
67 const std::vector<realT> & y
78 void setup(
const std::vector<realT> & x,
79 const std::vector<realT> & y
82 if(x.size() != y.size())
84 mxThrowException(
err::sizeerr,
"radprofIntegral",
"vectors must have same size");
90 for(
size_t n = 0; n < x.size(); ++n)
94 mxThrowException(
err::invalidarg,
"radprofIntegral",
"x values must > 0");
99 mxThrowException(
err::invalidarg,
"radprofIntegral",
"y values must > 0");
117 return pow(
static_cast<realT
>(10),
m_interp(log10(x)));
mxException for invalid arguments
mxException for a size error
Class to manage interpolation using the GSL interpolation library.
Interpolate a function in log space.
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.
gslInterpolator< gsl_interp_linear< realT > > m_interp
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.
std::vector< realT > m_logy
Internal storage of the lgo10 values of the y values.
std::vector< realT > m_logx
Internal storage of the log10 values of the x values.
realT operator()(const realT &x)
Calculate the interpolated value at the input.
Class for managing 1-D interpolation using the GNU Scientific Library.