8#include <compile_time_options.h>
10#ifdef DEAL_II_WITH_GSL
11#include <gsl/gsl_spline.h>
40 const std::vector<double> &y) noexcept
44 AssertNothrow(x_.size() == y_.size(), dealii::ExcInternalError());
45 AssertNothrow(x_.size() >= 2, dealii::ExcInternalError());
46 AssertNothrow(std::is_sorted(x_.begin(), x_.end()),
47 dealii::ExcInternalError());
49 spline = gsl_spline_alloc(gsl_interp_cspline, x_.size());
50 gsl_spline_init(spline, x_.data(), y_.data(), x_.size());
52 accel = gsl_interp_accel_alloc();
73 gsl_interp_accel_free(accel);
74 gsl_spline_free(spline);
83 inline double eval(
double x)
const
85 return gsl_spline_eval(spline, x, accel);
89 const std::vector<double> x_;
90 const std::vector<double> y_;
92 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