1#ifndef MC_XRAY_TRANSPORT_SPLINE_H
2#define MC_XRAY_TRANSPORT_SPLINE_H
5#include <unsupported/Eigen/Splines>
8namespace Interpolator {
18 virtual double operator()(
double x)
const = 0;
34 explicit Spline(
const Eigen::MatrixXd &data);
44 double scaledValue(
double x)
const;
45 Eigen::RowVectorXd scaledValues(Eigen::VectorXd
const &x_vec)
const;
47 Eigen::VectorXd x_vec_;
48 Eigen::VectorXd y_vec_;
51 Eigen::Spline<double, 1> spline_;
87 explicit Linear(
const Eigen::Matrix<double, Eigen::Dynamic, 2> &
data);
97 Eigen::VectorXd x_vec_;
98 Eigen::VectorXd y_vec_;
100 bool isXSmallerThanMin(
double x)
const;
101 bool isXBiggerThanMax(
double x)
const;
102 int findIndexOfNextLargestValue(
double x)
const;
103 double calculateInterpolatedY(
int idx,
double x)
const;
Abstract base class for interpolators.
Class which performs linear interpolation.
Linear(const Eigen::Matrix< double, Eigen::Dynamic, 2 > &data)
Constructor for the Linear class.
double operator()(double x) const override
Performs linear interpolation.
Class which performs linear interpolation on a log-log scale.
double operator()(double x) const override
Performs linear interpolation on a log-log scale.
LogLogLinear(const Eigen::Matrix< double, Eigen::Dynamic, 2 > &data)
Constructor for the LogLogLinear class.
Class which performs 3rd order spline interpolation on a log-log scale.
double operator()(double x) const override
Performs 3rd order spline interpolation on a log-log scale.
LogLogSpline(const Eigen::Matrix< double, Eigen::Dynamic, 2 > &data)
Constructor for the LogLogSpline class.
Class which performs 3rd order spline interpolation.
Spline(const Eigen::MatrixXd &data)
Constructor for the Spline class.
double operator()(double x) const override
Performs 3rd order spline interpolation.