1 #ifndef BALL_MATHS_CUBICSPLINE1D_H
2 #define BALL_MATHS_CUBICSPLINE1D_H
11 #ifndef BALL_COMMON_LIMITS_H
15 #ifndef BALL_DATATYPE_OPTIONS_H
52 CubicSpline1D(const std::vector<
float>& sample_positions,
53 const std::vector<
float>& sample_values,
54 bool return_average = false,
55 bool is_natural = true,
56 float lower_derivative = 0.0,
57 float upper_derivative = 0.0,
58 int verbosity = VERBOSITY_LEVEL_DEBUG);
72 CubicSpline1D(const std::vector<
float>& sample_positions,
73 const std::vector<
float>& sample_values,
75 bool is_natural = true,
76 float lower_derivative = 0.0,
77 float upper_derivative = 0.0,
78 int verbosity = VERBOSITY_LEVEL_DEBUG);
92 CubicSpline1D(const std::vector<
float>& sample_positions,
93 const std::vector<
float>& sample_values,
97 bool is_natural = true,
98 float lower_derivative = 0.0,
99 float upper_derivative = 0.0,
100 int verbosity = VERBOSITY_LEVEL_DEBUG);
114 CubicSpline1D(const std::vector<
float>& sample_positions,
115 const std::vector<
float>& sample_values,
118 bool return_average = false,
119 float default_value = std::numeric_limits<
float>::
min(),
120 bool is_natural = true,
121 float lower_derivative = 0.0,
122 float upper_derivative = 0.0,
123 int verbosity = VERBOSITY_LEVEL_DEBUG);
128 CubicSpline1D(const CubicSpline1D& cs1D);
132 virtual ~CubicSpline1D();
135 void setVerbosity(
int verbosity) { verbosity_ = verbosity; }
147 float operator () (
float x);
159 void setCurvature(std::vector<float> curvature);
165 void setValues(std::vector<float> values,
bool recompute =
true);
169 std::vector<float>
getValues()
const {
return sample_values_;}
179 void setPositions(std::vector<float> positions,
bool recompute =
true);
204 void makeNatural(
bool recompute =
true);
210 void setBoudaryDerivatives(
float lower_derivative,
float upper_derivative,
bool recompute =
true);
217 void setLowerDerivative(
float derivative,
bool recompute =
true);
227 void setUpperDerivative(
float derivative,
bool recompute =
true);