42 <<
"size: X=" << x.
size() <<
", Y=" << y.
size();
50 final_y.push_back(y[0]);
54 logger.
warn() <<
"Ignoring duplicate pair (" << x[i] <<
", " << y[i]
55 <<
") during interpolation";
59 <<
"supported. Entries: (" << x[i] <<
", " << y[i] <<
") and ("
60 << x[i-1] <<
", " << y[i-1] <<
")";
65 <<
"but found " << x[i] <<
" after " << x[i-1];
68 final_y.push_back(y[i]);
83 for (
auto& pair : dataset) {
85 y.push_back(pair.second);
std::unique_ptr< Function > splineInterpolation(const std::vector< double > &x, const std::vector< double > &y)
Performs cubic spline interpolation for the given set of data points.
std::unique_ptr< Function > linearInterpolation(const std::vector< double > &x, const std::vector< double > &y)
Performs linear interpolation for the given set of data points.
void warn(const std::string &logMessage)
static Elements::Logging logger
ELEMENTS_API std::unique_ptr< Function > interpolate(const std::vector< double > &x, const std::vector< double > &y, InterpolationType type)
This module provides an interface for accessing two dimensional datasets (pairs of (X...
InterpolationType
Enumeration of the different supported interpolation types.
static Logging getLogger(const std::string &name="")