9#include <gsl/gsl_spline.h>
38 const std::vector<double> &y) noexcept
42 AssertNothrow(x_.size() == y_.size(), dealii::ExcInternalError());
43 AssertNothrow(x_.size() >= 2, dealii::ExcInternalError());
44 AssertNothrow(std::is_sorted(x_.begin(), x_.end()),
45 dealii::ExcInternalError());
47 spline = gsl_spline_alloc(gsl_interp_cspline, x_.size());
48 gsl_spline_init(spline, x_.data(), y_.data(), x_.size());
50 accel = gsl_interp_accel_alloc();
71 gsl_interp_accel_free(accel);
72 gsl_spline_free(spline);
81 inline double eval(
double x)
const
83 return gsl_spline_eval(spline, x, accel);
87 const std::vector<double> x_;
88 const std::vector<double> y_;
90 mutable gsl_interp_accel *accel;
CubicSpline & operator=(const CubicSpline &)=delete
CubicSpline(const CubicSpline ©)
double eval(double x) const
CubicSpline(const std::vector< double > &x, const std::vector< double > &y) noexcept