1 #ifndef BALL_MATHS_CUBICSPLINE2D_H
2 #define BALL_MATHS_CUBICSPLINE2D_H
7 #ifndef BALL_MATHS_CUBICSPLINE1D_H
11 #ifndef BALL_COMMON_EXCEPTION_H
52 CubicSpline2D(const std::vector<std::vector<
float> >& sample_positions_x,
53 const std::vector<
float>& sample_positions_y,
54 const std::vector<std::vector<
float> >& sample_values,
55 bool return_average = false,
56 bool is_natural = true,
57 const std::vector<
float>& x_lower_derivatives = std::vector<
float>(),
58 const std::vector<
float>& x_upper_derivatives = std::vector<
float>(),
59 float y_lower_derivative = 0.,
60 float y_upper_derivative = 0.,
61 int verbosity = VERBOSITY_LEVEL_DEBUG);
81 CubicSpline2D(const std::vector<std::vector<
float> >& sample_positions_x,
82 const std::vector<
float>& sample_positions_y,
83 const std::vector<std::vector<
float> >& sample_values,
84 const std::vector<
float>& x_default_values,
85 float y_default_value,
86 const std::vector<
float>& x_lower_bounds,
87 const std::vector<
float>& x_upper_bounds,
90 bool is_natural = true,
91 const std::vector<
float>& x_lower_derivatives = std::vector<
float>(),
92 const std::vector<
float>& x_upper_derivatives = std::vector<
float>(),
93 float y_lower_derivative = 0.0,
94 float y_upper_derivative = 0.0,
95 int verbosity = VERBOSITY_LEVEL_DEBUG);
117 CubicSpline2D(const std::vector<
float>& sample_positions_x,
118 const std::vector<
float>& sample_positions_y,
119 const std::vector<std::vector<
float> >& sample_values,
120 bool return_average = false,
121 bool is_natural = true,
122 const std::vector<
float>& x_lower_derivatives = std::vector<
float>(),
123 const std::vector<
float>& x_upper_derivatives = std::vector<
float>(),
124 float y_lower_derivative = 0.,
125 float y_upper_derivative = 0.,
126 int verbosity = VERBOSITY_LEVEL_DEBUG);
144 CubicSpline2D(const std::vector<
float>& sample_positions_x,
145 const std::vector<
float>& sample_positions_y,
146 const std::vector<std::vector<
float> >& sample_values,
147 const std::vector<
float>& x_default_values,
148 float y_default_value,
149 const std::vector<
float>& x_lower_bounds,
150 const std::vector<
float>& x_upper_bounds,
153 bool is_natural = true,
154 const std::vector<
float>& x_lower_derivatives = std::vector<
float>(),
155 const std::vector<
float>& x_upper_derivatives = std::vector<
float>(),
156 float y_lower_derivative = 0.0,
157 float y_upper_derivative = 0.0,
158 int verbosity = VERBOSITY_LEVEL_DEBUG);
163 CubicSpline2D(const CubicSpline2D& cs2D);
167 virtual ~CubicSpline2D();
170 void setVerbosity(
int verbosity);
182 float operator () (
float x,
float y);
187 float getXDefaultValue(
Index x) const;
191 float getYDefaultValue()
const {
return y_default_value_;}
221 float getXLowerBounds(
Index x)
const;
226 float getXUpperBounds(
Index x)
const;
230 bool isXNatural(
Index x);
236 void makeXNatural(
Index x,
bool recompute =
true);
241 void makeAllXNatural(
bool recompute =
true);
247 void makeYNatural(
bool y_is_natural,
bool recompute =
true);
254 void setXLowerDerivatives(vector<float> ld,
bool recompute =
true);
255 void setXUpperDerivatives(vector<float> ud,
bool recompute =
true);
260 float getXLowerDerivatives(
Index x);
265 float getXUpperDerivatives(
Index x);
271 void setYLowerDerivative (
float ld,
bool recompute =
true);
272 void setYUpperDerivative (
float ud,
bool recompute =
true);
301 void createBiCubicSpline();