1 #ifndef BALL_MATHS_CUBICSPLINE1D_H
2 #define BALL_MATHS_CUBICSPLINE1D_H
11 #ifndef BALL_DATATYPE_OPTIONS_H
48 CubicSpline1D(const std::vector<
float>& sample_positions,
49 const std::vector<
float>& sample_values,
50 bool return_average = false,
51 bool is_natural = true,
52 float lower_derivative = 0.0,
53 float upper_derivative = 0.0,
54 int verbosity = VERBOSITY_LEVEL_DEBUG);
68 CubicSpline1D(const std::vector<
float>& sample_positions,
69 const std::vector<
float>& sample_values,
71 bool is_natural = true,
72 float lower_derivative = 0.0,
73 float upper_derivative = 0.0,
74 int verbosity = VERBOSITY_LEVEL_DEBUG);
88 CubicSpline1D(const std::vector<
float>& sample_positions,
89 const std::vector<
float>& sample_values,
93 bool is_natural = true,
94 float lower_derivative = 0.0,
95 float upper_derivative = 0.0,
96 int verbosity = VERBOSITY_LEVEL_DEBUG);
110 CubicSpline1D(const std::vector<
float>& sample_positions,
111 const std::vector<
float>& sample_values,
114 bool return_average = false,
115 float default_value = std::numeric_limits<
float>::
min(),
116 bool is_natural = true,
117 float lower_derivative = 0.0,
118 float upper_derivative = 0.0,
119 int verbosity = VERBOSITY_LEVEL_DEBUG);
124 CubicSpline1D(const CubicSpline1D& cs1D);
128 virtual ~CubicSpline1D();
131 void setVerbosity(
int verbosity) { verbosity_ = verbosity; }
143 float operator () (
float x);
155 void setCurvature(std::vector<float> curvature);
161 void setValues(std::vector<float> values,
bool recompute =
true);
165 std::vector<float>
getValues()
const {
return sample_values_;}
175 void setPositions(std::vector<float> positions,
bool recompute =
true);
200 void makeNatural(
bool recompute =
true);
206 void setBoudaryDerivatives(
float lower_derivative,
float upper_derivative,
bool recompute =
true);
213 void setLowerDerivative(
float derivative,
bool recompute =
true);
223 void setUpperDerivative(
float derivative,
bool recompute =
true);
238 std::vector<float> sample_positions_;
240 std::vector<float> sample_values_;
242 std::vector<float> curvature_;
245 bool return_average_;
251 float default_value_;
263 float lower_derivative_;
266 float upper_derivative_;
float getLowerBound() const
#define BALL_CREATE(name)
void setUpperBound(float ub)
std::vector< float > getValues() const
static const int VERBOSITY_LEVEL_CRITICAL
std::vector< float > getPositions() const
float getUpperBound() const
float getDefaultValue() const
float getUpperDerivative() const
void setLowerBound(float lb)
void setDefaultValue(float value)
static const int VERBOSITY_LEVEL_DEBUG
std::vector< float > getCurvature() const
T min(const T &a, const T &b)
float getLowerDerivative() const