1#ifndef LSST_GAUSS2D_FIT_GSLINTERPOLATOR_H
2#define LSST_GAUSS2D_FIT_GSLINTERPOLATOR_H
4#ifdef LSST_GAUSS2D_FIT_HAS_GSL
7#include "interpolation.h"
9#include "lsst/gauss2d/object.h"
11#include <gsl/gsl_errno.h>
12#include <gsl/gsl_spline.h>
14namespace lsst::gauss2d::fit {
19class GSLInterpolator :
public Object {
21 explicit GSLInterpolator(std::vector<double> x, std::vector<double> y,
22 InterpType interp_type = INTERPTYPE_DEFAULT);
25 const InterpType get_interp_type()
const;
26 static constexpr InterpType INTERPTYPE_DEFAULT = InterpType::cspline;
29 double get_knot_x(
size_t idx)
const;
31 double get_knot_y(
size_t idx)
const;
34 double eval(
double x)
const;
36 double eval_deriv(
double x)
const;
40 std::string repr(
bool name_keywords =
false,
41 std::string_view namespace_separator = Object::CC_NAMESPACE_SEPARATOR)
const override;
42 std::string str()
const override;
45 gsl_interp_accel* _acc;
48 const InterpType _interp_type;
50 std::vector<double> _x;
51 std::vector<double> _y;