97 double integrate(
const double a,
const double b)
const override {
144 int n =
x.
size() - 1;
148 for (
int i = 0;
i < n;
i++)
153 for (
int i = 1;
i < n; ++
i) {
154 double g = 2. * (
x[
i + 1] -
x[
i - 1]) -
h[
i - 1] *
mu[
i - 1];
156 z[
i] = (3. * (
y[
i + 1] *
h[
i - 1] -
y[
i] * (
x[
i + 1] -
x[
i - 1]) +
y[
i - 1] *
h[
i]) / (
h[
i - 1] *
h[
i]) -
157 h[
i - 1] *
z[
i - 1]) /
170 for (
int j = n - 1;
j >= 0;
j--) {
179 for (
int i = 0;
i < n;
i++) {
std::vector< double > m_coef2
std::vector< double > m_coef0
std::unique_ptr< NAryFunction > clone() const override
CubicInterpolator(std::vector< double > knots, std::vector< double > coef0, std::vector< double > coef1, std::vector< double > coef2, std::vector< double > coef3)
double integrate(const double a, const double b) const override
std::vector< double > m_coef3
std::vector< double > m_coef1
void operator()(const std::vector< double > &xs, std::vector< double > &out) const override
double antiderivative(int i, double x) const
virtual ~CubicInterpolator()=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::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.
std::array< std::vector< double >, N > Coordinates
Used to pass the grid coordinates to interpn. Internally will make a copy of the required values.