Alexandria
2.18
Please provide a description of the project.
|
Go to the documentation of this file.
45 <<
"size: X=" << x.
size() <<
", Y=" << y.
size();
48 if (x.
size() == 1 && extrapolate) {
50 return make_unique<FunctionAdapter>([c](
double) {
return c; });
64 if (x[i] == x[i - 1]) {
65 if (y[i] == y[i - 1]) {
66 logger.
warn() <<
"Ignoring duplicate pair (" << x[i] <<
", " << y[i] <<
") during interpolation";
70 <<
"supported. Entries: (" << x[i] <<
", " << y[i] <<
") and (" << x[i - 1] <<
", "
74 if (x[i] < x[i - 1]) {
76 <<
"but found " << x[i] <<
" after " << x[i - 1];
83 case InterpolationType::LINEAR:
96 for (
auto& pair : dataset) {
This module provides an interface for accessing two dimensional datasets (pairs of (X,...
static Elements::Logging logger
void warn(const std::string &logMessage)
std::unique_ptr< Function > linearInterpolation(const std::vector< double > &x, const std::vector< double > &y, bool extrapolate)
Performs linear interpolation for the given set of data points.
InterpolationType
Enumeration of the different supported interpolation types.
static Logging getLogger(const std::string &name="")
T emplace_back(T... args)
std::unique_ptr< Function > splineInterpolation(const std::vector< double > &x, const std::vector< double > &y, bool extrapolate)
Performs cubic spline interpolation for the given set of data points.
size_t size() const
Get the size of the vector container.
ELEMENTS_API std::unique_ptr< Function > interpolate(const std::vector< double > &x, const std::vector< double > &y, InterpolationType type, bool extrapolate=false)