37 py::class_<Interpolate, std::shared_ptr<Interpolate>> clsInterpolate(mod,
"Interpolate");
38 py::enum_<Interpolate::Style>(clsInterpolate,
"Style")
39 .value(
"UNKNOWN", Interpolate::Style::UNKNOWN)
40 .value(
"CONSTANT", Interpolate::Style::CONSTANT)
41 .value(
"LINEAR", Interpolate::Style::LINEAR)
42 .value(
"NATURAL_SPLINE", Interpolate::Style::NATURAL_SPLINE)
43 .value(
"CUBIC_SPLINE", Interpolate::Style::CUBIC_SPLINE)
44 .value(
"CUBIC_SPLINE_PERIODIC", Interpolate::Style::CUBIC_SPLINE_PERIODIC)
45 .value(
"AKIMA_SPLINE", Interpolate::Style::AKIMA_SPLINE)
46 .value(
"AKIMA_SPLINE_PERIODIC", Interpolate::Style::AKIMA_SPLINE_PERIODIC)
47 .value(
"NUM_STYLES", Interpolate::Style::NUM_STYLES)
50 clsInterpolate.def(
"interpolate", [](
Interpolate &t,
double const x) {
58 clsInterpolate.def(
"interpolate",
60 Interpolate::interpolate);
63 (ndarray::Array<double, 1> (
Interpolate::*)(ndarray::Array<double const, 1>
const &)
const) &
64 Interpolate::interpolate);
66 mod.def(
"makeInterpolate",
69 "x"_a,
"y"_a,
"style"_a = Interpolate::AKIMA_SPLINE);
71 ndarray::Array<double const, 1>
const &
y,
73 "x"_a,
"y"_a,
"style"_a = Interpolate::AKIMA_SPLINE);
Interpolate::Style stringToInterpStyle(std::string const &style)
Conversion function to switch a string to an Interpolate::Style.
virtual double interpolate(double const x) const =0
std::shared_ptr< Interpolate > makeInterpolate(std::vector< double > const &x, std::vector< double > const &y, Interpolate::Style const style=Interpolate::AKIMA_SPLINE)
A factory function to make Interpolate objects.
Interpolate::Style lookupMaxInterpStyle(int const n)
Get the highest order Interpolation::Style available for 'n' points.
int lookupMinInterpPoints(Interpolate::Style const style)
Get the minimum number of points needed to use the requested interpolation style. ...