6 #include <gsl/gsl_errno.h> 7 #include <gsl/gsl_spline.h> 17 gsl_spline *_workspace =
nullptr;
18 gsl_interp_accel *_accel =
nullptr;
33 template<
class X,
class Y>
34 inline Interpolation(
const gsl_interp_type *type,
const X &x,
const Y &y) {
35 size_t _dim = x.size();
36 _workspace = gsl_spline_alloc(type, _dim);
37 _accel = gsl_interp_accel_alloc();
38 gsl_spline_init(_workspace, &x[0], &y[0], _dim);
48 size_t _dim = x.
size();
49 _workspace = gsl_spline_alloc(type, _dim);
50 _accel = gsl_interp_accel_alloc();
51 gsl_spline_init(_workspace, x.
begin(), y.
begin(), _dim);
66 if (_accel !=
nullptr) {
67 gsl_interp_accel_free(_accel);
70 if (_workspace !=
nullptr) {
71 gsl_spline_free(_workspace);
87 inline double eval(
double val) {
90 const int errorcode = gsl_spline_eval_e(_workspace,
107 const int errorcode = gsl_spline_eval_deriv_e(_workspace,
122 const int errorcode = gsl_spline_eval_deriv2_e(_workspace,
138 const int errorcode = gsl_spline_eval_integ_e(_workspace,
151 inline size_t size()
const {
return _workspace->size; }
Interpolation()=delete
InterpolationX Einsatz des Standardkonstruktors nicht erlaubt.
static void error_if(const std::string &s, bool arg)
error_if Fehler wenn Bedingung erfüllt ist
Interpolation(const gsl_interp_type *type, const gsl::Vector &x, const gsl::Vector &y)
Interpolation.
~Interpolation()
~Interpolation Destruktor gsl- Strukturen werden freigegeben
Interpolation(const gsl_interp_type *type, const X &x, const Y &y)
Interpolation.
Interpolation & operator=(const Interpolation &obj)=delete
operator = Zuweisungsoperator nicht erlaubt
double integral(double xmin, double xmax)
integral numerische Integration
The Vector class Klasse für gsl-Vektoren zussamengesetzt aus Komponenten.
double deriv(double val)
deriv erste Ableitung der Funktion ...
double deriv2(double val)
deriv2 zweite Ableitung der Funktion ...
The Spline class Interpolation von diskreten Daten.
double eval(double val)
eval Funktionswert...