88 double integrate(
const double a,
const double b)
const override {
133 for (
size_t i = 0;
i <
x.
size() - 1;
i++) {
134 double dx = (
x[
i + 1] -
x[
i]);
LinearInterpolator(std::vector< double > knots, std::vector< double > coef0, std::vector< double > coef1)
const std::vector< double > m_coef0
std::unique_ptr< NAryFunction > clone() const override
void operator()(const std::vector< double > &xs, std::vector< double > &out) const override
double integrate(const double a, const double b) const override
double antiderivative(int i, double x) const
const std::vector< double > m_coef1
virtual ~LinearInterpolator()=default
double operator()(double x) const override
Represents a piecewise function.
ssize_t findKnot(double x) const
std::vector< double > m_knots
A vector where the knots are kept.
std::array< std::vector< double >, N > Coordinates
Used to pass the grid coordinates to interpn. Internally will make a copy of the required values.
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.