BALL
1.4.79
|
#include <BALL/MATHS/cubicSpline2D.h>
Static Public Attributes | |
static const int | VERBOSITY_LEVEL_DEBUG |
static const int | VERBOSITY_LEVEL_CRITICAL |
Constructors and Destructors. | |
CubicSpline2D () | |
CubicSpline2D (const std::vector< std::vector< float > > &sample_positions_x, const std::vector< float > &sample_positions_y, const std::vector< std::vector< float > > &sample_values, bool return_average=false, bool is_natural=true, const std::vector< float > &x_lower_derivatives=std::vector< float >(), const std::vector< float > &x_upper_derivatives=std::vector< float >(), float y_lower_derivative=0., float y_upper_derivative=0., int verbosity=VERBOSITY_LEVEL_DEBUG) | |
CubicSpline2D (const std::vector< std::vector< float > > &sample_positions_x, const std::vector< float > &sample_positions_y, const std::vector< std::vector< float > > &sample_values, const std::vector< float > &x_default_values, float y_default_value, const std::vector< float > &x_lower_bounds, const std::vector< float > &x_upper_bounds, float y_lower_bound, float y_upper_bound, bool is_natural=true, const std::vector< float > &x_lower_derivatives=std::vector< float >(), const std::vector< float > &x_upper_derivatives=std::vector< float >(), float y_lower_derivative=0.0, float y_upper_derivative=0.0, int verbosity=VERBOSITY_LEVEL_DEBUG) | |
CubicSpline2D (const std::vector< float > &sample_positions_x, const std::vector< float > &sample_positions_y, const std::vector< std::vector< float > > &sample_values, bool return_average=false, bool is_natural=true, const std::vector< float > &x_lower_derivatives=std::vector< float >(), const std::vector< float > &x_upper_derivatives=std::vector< float >(), float y_lower_derivative=0., float y_upper_derivative=0., int verbosity=VERBOSITY_LEVEL_DEBUG) | |
CubicSpline2D (const std::vector< float > &sample_positions_x, const std::vector< float > &sample_positions_y, const std::vector< std::vector< float > > &sample_values, const std::vector< float > &x_default_values, float y_default_value, const std::vector< float > &x_lower_bounds, const std::vector< float > &x_upper_bounds, float y_lower_bound, float y_upper_bound, bool is_natural=true, const std::vector< float > &x_lower_derivatives=std::vector< float >(), const std::vector< float > &x_upper_derivatives=std::vector< float >(), float y_lower_derivative=0.0, float y_upper_derivative=0.0, int verbosity=VERBOSITY_LEVEL_DEBUG) | |
CubicSpline2D (const CubicSpline2D &cs2D) | |
virtual | ~CubicSpline2D () |
void | setVerbosity (int verbosity) |
Set the verbosity of the spline computation and evaluation. More... | |
float | operator() (float x, float y) |
float | getXDefaultValue (Index x) const |
float | getYDefaultValue () const |
void | setXDefaultValues (vector< float > x_default_values) |
void | setYDefaultValue (float y_default_value) |
void | setYLowerBound (float lb) |
void | setYUpperBound (float ub) |
float | getYLowerBound () |
float | getYUpperBound () |
void | setXLowerBounds (vector< float > lb) |
void | setXUpperBounds (vector< float > ub) |
const vector< float > & | getXLowerBounds () const |
const vector< float > & | getXUpperBounds () const |
float | getXLowerBounds (Index x) const |
float | getXUpperBounds (Index x) const |
bool | isXNatural (Index x) |
vector< bool > | isXNatural () const |
void | makeXNatural (Index x, bool recompute=true) |
void | makeAllXNatural (bool recompute=true) |
void | makeYNatural (bool y_is_natural, bool recompute=true) |
bool | isYNatural () |
void | setXLowerDerivatives (vector< float > ld, bool recompute=true) |
void | setXUpperDerivatives (vector< float > ud, bool recompute=true) |
float | getXLowerDerivatives (Index x) |
float | getXUpperDerivatives (Index x) |
vector< float > & | getXLowerDerivatives () |
vector< float > & | getXUpperDerivatives () |
void | setYLowerDerivative (float ld, bool recompute=true) |
void | setYUpperDerivative (float ud, bool recompute=true) |
float | getYLowerDerivative () |
float | getYUpperDerivative () |
CubicSpline1D & | getSpline (Position i) |
const CubicSpline1D & | getSpline (Position i) const |
Size | getNumberOfSplines () const |
Definition at line 17 of file cubicSpline2D.h.
BALL::CubicSpline2D::CubicSpline2D | ( | ) |
Default constructor.
BALL::CubicSpline2D::CubicSpline2D | ( | const std::vector< std::vector< float > > & | sample_positions_x, |
const std::vector< float > & | sample_positions_y, | ||
const std::vector< std::vector< float > > & | sample_values, | ||
bool | return_average = false , |
||
bool | is_natural = true , |
||
const std::vector< float > & | x_lower_derivatives = std::vector< float >() , |
||
const std::vector< float > & | x_upper_derivatives = std::vector< float >() , |
||
float | y_lower_derivative = 0. , |
||
float | y_upper_derivative = 0. , |
||
int | verbosity = VERBOSITY_LEVEL_DEBUG |
||
) |
Detailed constructor Given the increasingly sorted sample positions { sample_positions_y_} in y direction, increasingly sorted sample positions { sample_positions_x_} in x direction and the corresponding sample values { sample_values} a 2D spline is created by storing for each y sample position the corresponding 1d spline in x direction. By default, we assume the first and the last values to be the lower and upper bounds. If the { return_average_} flag is set to true, the default return values are set to the spline average. If the { is_natural} flag is set to true, all 1D splines and the 1D spline in y direction used in the { operator() } will be natural. Otherwise { x_lower_derivatives} and { x_upper_derivatives} are taken as first derivatives of the first/last sample positions in x direction and { y_lower_derivative} and { y_upper_derivative} are taken as the first derivatives of the first/last derivative in y direction. By default, the derivatives are set to zero.
BALL::CubicSpline2D::CubicSpline2D | ( | const std::vector< std::vector< float > > & | sample_positions_x, |
const std::vector< float > & | sample_positions_y, | ||
const std::vector< std::vector< float > > & | sample_values, | ||
const std::vector< float > & | x_default_values, | ||
float | y_default_value, | ||
const std::vector< float > & | x_lower_bounds, | ||
const std::vector< float > & | x_upper_bounds, | ||
float | y_lower_bound, | ||
float | y_upper_bound, | ||
bool | is_natural = true , |
||
const std::vector< float > & | x_lower_derivatives = std::vector< float >() , |
||
const std::vector< float > & | x_upper_derivatives = std::vector< float >() , |
||
float | y_lower_derivative = 0.0 , |
||
float | y_upper_derivative = 0.0 , |
||
int | verbosity = VERBOSITY_LEVEL_DEBUG |
||
) |
Detailed constructor Given the increasingly sorted sample positions { sample_positions_y_} in y direction, increasingly sorted sample positions { sample_positions_x_} in x direction and the corresponding sample values { sample_values} a 2D spline is created by storing for each y sample position the corresponding 1d spline in x direction. The { return_average} flag is set to false and the default values { x_default_values_} and { y_default_value_} is set to the given values. The lower and upper bounds in x and y direction are set to the given values. If the { is_natural} flag is set to true, all 1D splines and the 1D spline in y direction used in the { operator() } will be natural. Otherwise { x_lower_derivatives} and { x_upper_derivatives} are taken as first derivatives of the first/last sample positions in x direction and { y_lower_derivative} and { y_upper_derivative} are taken as the first derivatives of the first/last derivative in y direction. By default, the derivatives are set to zero.
BALL::CubicSpline2D::CubicSpline2D | ( | const std::vector< float > & | sample_positions_x, |
const std::vector< float > & | sample_positions_y, | ||
const std::vector< std::vector< float > > & | sample_values, | ||
bool | return_average = false , |
||
bool | is_natural = true , |
||
const std::vector< float > & | x_lower_derivatives = std::vector< float >() , |
||
const std::vector< float > & | x_upper_derivatives = std::vector< float >() , |
||
float | y_lower_derivative = 0. , |
||
float | y_upper_derivative = 0. , |
||
int | verbosity = VERBOSITY_LEVEL_DEBUG |
||
) |
Detailed constructor Given the increasingly sorted sample positions { sample_positions_y_} in y direction, increasingly sorted sample positions { sample_positions_x_} in x direction (same for all splines in x direction! ) and the corresponding sample values { sample_values} a 2D spline is created by storing for each y sample position the corresponding 1d spline in x direction. By default, we assume the first and the last values to be the lower and upper bounds. If the { return_average_} flag is set to true, the default return values are set to the spline average. If the { is_natural} flag is set to true, all 1D splines and the 1D spline in y direction used in the { operator() } will be natural. Otherwise { x_lower_derivatives} and { x_upper_derivatives} are taken as first derivatives of the first/last sample positions in x direction and { y_lower_derivative} and { y_upper_derivative} are taken as the first derivatives of the first/last derivative in y direction. By default, the derivatives are set to zero.
BALL::CubicSpline2D::CubicSpline2D | ( | const std::vector< float > & | sample_positions_x, |
const std::vector< float > & | sample_positions_y, | ||
const std::vector< std::vector< float > > & | sample_values, | ||
const std::vector< float > & | x_default_values, | ||
float | y_default_value, | ||
const std::vector< float > & | x_lower_bounds, | ||
const std::vector< float > & | x_upper_bounds, | ||
float | y_lower_bound, | ||
float | y_upper_bound, | ||
bool | is_natural = true , |
||
const std::vector< float > & | x_lower_derivatives = std::vector< float >() , |
||
const std::vector< float > & | x_upper_derivatives = std::vector< float >() , |
||
float | y_lower_derivative = 0.0 , |
||
float | y_upper_derivative = 0.0 , |
||
int | verbosity = VERBOSITY_LEVEL_DEBUG |
||
) |
Detailed constructor Given the increasingly sorted sample positions { sample_positions_y_} in y direction, increasingly sorted sample positions { sample_positions_x_} in x direction and the corresponding sample values { sample_values} a 2D spline is created by storing for each y sample position the corresponding 1d spline in x direction. The { return_average} flag is set to false and the default values { x_default_values_} and { y_default_value_} is set to the given values. The lower and upper bounds in x and y direction are set to the given values. If the { is_natural} flag is set to true, all 1D splines and the 1D spline in y direction used in the { operator() } will be natural. Otherwise { x_lower_derivatives} and { x_upper_derivatives} are taken as first derivatives of the first/last sample positions in x direction and { y_lower_derivative} and { y_upper_derivative} are taken as the first derivatives of the first/last derivative in y direction. By default, the derivatives are set to zero.
BALL::CubicSpline2D::CubicSpline2D | ( | const CubicSpline2D & | cs2D | ) |
Copy constructor.
|
virtual |
Destructor.
|
inline |
Definition at line 289 of file cubicSpline2D.h.
CubicSpline1D& BALL::CubicSpline2D::getSpline | ( | Position | i | ) |
Return the i-th spline
Exception::OutOfRange | if i >= getNumberOfSplines() |
const CubicSpline1D& BALL::CubicSpline2D::getSpline | ( | Position | i | ) | const |
Return the i-th spline
Exception::OutOfRange | if i >= getNumberOfSplines() |
Returns the x-th default value in x direction.
Exception::OutOfRange | if x >= number_of_default_values |
|
inline |
Returns all lower bounds in x direction.
Definition at line 212 of file cubicSpline2D.h.
Get the lower bounds in x direction
Exception::OutOfRange | if x >= x_lower_bounds_.size() |
Get the lower derivatives in x direction
Exception::OutOfRange | if x >= x_lower_derivatives_.size() |
|
inline |
Definition at line 267 of file cubicSpline2D.h.
|
inline |
Returns all upper bounds in x direction.
Definition at line 216 of file cubicSpline2D.h.
Get the upper bounds in x direction
Exception::OutOfRange | if x >= x_upper_bounds_.size() |
Get the upper derivatives in x direction
Exception::OutOfRange | if x >= x_upper_derivatives_.size() |
|
inline |
Definition at line 268 of file cubicSpline2D.h.
|
inline |
Returns the y-th default value in x direction.
Definition at line 191 of file cubicSpline2D.h.
|
inline |
Definition at line 204 of file cubicSpline2D.h.
|
inline |
Definition at line 275 of file cubicSpline2D.h.
|
inline |
Definition at line 205 of file cubicSpline2D.h.
|
inline |
Definition at line 276 of file cubicSpline2D.h.
Returns true if the x-th spline in x direction is natural. If x is out of bound, std::numeric_limits<float>::min()
is returned.
|
inline |
Definition at line 231 of file cubicSpline2D.h.
|
inline |
Returns true if the spline in y direction for each call in { operator ()} is natural.
Definition at line 251 of file cubicSpline2D.h.
void BALL::CubicSpline2D::makeAllXNatural | ( | bool | recompute = true | ) |
Sets the flag { is_natural_} for all x-th splines to true. By default the method recomputes all splines. If the argument is false, no recomputation is done.
Sets the flag { is_natural_} for the x-th spline to true. By default the method recomputes the spline. If the argument is false, no recomputation is done.
Sets the flag { y_is_natural_} to true. Since the spline in y direction is created for each call of { operator ()} new, recomputation is not necessary.
A method to evaluate the 2Dspline at the access values x | y. First all spline in y-direction are evaluated at x. Based on these values a temporary 1D spline is created, which will be evaluated at y. If the access values are out of bound or if we have too less points given for a spline the { default_value} is returned. If the spacing is zero, std::numeric_limits<float>::min()
is returned.
void BALL::CubicSpline2D::setVerbosity | ( | int | verbosity | ) |
Set the verbosity of the spline computation and evaluation.
|
inline |
Definition at line 194 of file cubicSpline2D.h.
|
inline |
Definition at line 207 of file cubicSpline2D.h.
|
inline |
Definition at line 208 of file cubicSpline2D.h.
|
inline |
Definition at line 197 of file cubicSpline2D.h.
|
inline |
Definition at line 201 of file cubicSpline2D.h.
|
inline |
Definition at line 202 of file cubicSpline2D.h.
|
static |
Definition at line 22 of file cubicSpline2D.h.
|
static |
Definition at line 21 of file cubicSpline2D.h.