32 const Eigen::VectorXd &y) {
33 if (x.size() != y.size()) {
34 throw std::invalid_argument(
35 "error in CubicSpline::Interpolate : sizes of vectors x and y do not "
40 throw std::invalid_argument(
41 "error in CubicSpline::Interpolate : vectors x and y have to contain "
45 const Index N = x.size();
50 Eigen::VectorXd temp = Eigen::VectorXd::Zero(N);
52 Eigen::MatrixXd
A = Eigen::MatrixXd::Zero(N, N);
54 for (
Index i = 0; i < N - 2; ++i) {
76 throw std::runtime_error(
77 "erro in CubicSpline::Interpolate: case splineDerivativeZero not "
82 Eigen::HouseholderQR<Eigen::MatrixXd> QR(
A);
87 if (x.size() != y.size()) {
88 throw std::invalid_argument(
89 "error in CubicSpline::Fit : sizes of vectors x and y do not match");
92 const Index N = x.size();
102 Eigen::MatrixXd
A = Eigen::MatrixXd::Zero(N, 2 * ngrid);
103 Eigen::MatrixXd
B = Eigen::MatrixXd::Zero(
113#ifndef __INTEL_LLVM_COMPILER
116 for (
Index i = 0; i < 2 * ngrid; i++) {
117 if ((std::isinf(sol(i))) || (std::isnan(sol(i)))) {
118 throw std::runtime_error(
119 "error in CubicSpline::Fit : value nan occurred due to wrong fitgrid "
125 f_ = sol.segment(0, ngrid);
126 f2_ = sol.segment(ngrid, ngrid);
131 return A(r) *
f_[interval] +
B(r) *
f_[interval + 1] +
C(r) *
f2_[interval] +
132 D(r) *
f2_[interval + 1];
164 return (0.5 * xxi * xxi - (1.0 / 6.0) * xxi * xxi * xxi / h -
165 (1.0 / 3.0) * xxi * h);
172 return (xxi - 0.5 * xxi * xxi / h - h / 3);
180 return ((1.0 / 6.0) * xxi * xxi * xxi / h - (1.0 / 6.0) * xxi * h);
187 return (0.5 * xxi * xxi / h - (1.0 / 6.0) * h);
195 return (1.0 / 6.0) * (
r_[i + 1] -
r_[i]);
199 return (1.0 / 3.0) * (
r_[i + 1] -
r_[i]);
203 return -1.0 / (
r_[i + 2] -
r_[i + 1]);
209 return -(1.0 / 3.0) * (
r_[i + 2] -
r_[i + 1]);
213 return -(1.0 / 6.0) * (
r_[i + 2] -
r_[i + 1]);
base class for all analysis tools