Loading...
Searching...
No Matches
cubicSpline1D.h
Go to the documentation of this file.
#ifndef BALL_MATHS_CUBICSPLINE1D_H
#define BALL_MATHS_CUBICSPLINE1D_H
#include <set>
#include <map>
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifndef BALL_DATATYPE_OPTIONS_H
# include <BALL/DATATYPE/options.h>
#endif
namespace BALL
{
class BALL_EXPORT CubicSpline1D
{
public:
static const int VERBOSITY_LEVEL_DEBUG;
static const int VERBOSITY_LEVEL_CRITICAL;
BALL_CREATE(CubicSpline1D)
CubicSpline1D();
CubicSpline1D(const std::vector<float>& sample_positions,
const std::vector<float>& sample_values,
bool return_average = false,
bool is_natural = true,
float lower_derivative = 0.0,
float upper_derivative = 0.0,
int verbosity = VERBOSITY_LEVEL_DEBUG);
CubicSpline1D(const std::vector<float>& sample_positions,
const std::vector<float>& sample_values,
float default_value,
bool is_natural = true,
float lower_derivative = 0.0,
float upper_derivative = 0.0,
int verbosity = VERBOSITY_LEVEL_DEBUG);
CubicSpline1D(const std::vector<float>& sample_positions,
const std::vector<float>& sample_values,
float default_value,
float lower_bound,
float upper_bound,
bool is_natural = true,
float lower_derivative = 0.0,
float upper_derivative = 0.0,
int verbosity = VERBOSITY_LEVEL_DEBUG);
CubicSpline1D(const std::vector<float>& sample_positions,
const std::vector<float>& sample_values,
float lower_bound,
float upper_bound,
bool return_average = false,
float default_value = std::numeric_limits<float>::min(),
bool is_natural = true,
float lower_derivative = 0.0,
float upper_derivative = 0.0,
int verbosity = VERBOSITY_LEVEL_DEBUG);
CubicSpline1D(const CubicSpline1D& cs1D);
virtual ~CubicSpline1D();
void setVerbosity(int verbosity) { verbosity_ = verbosity; }
int getVerbosity() const { return verbosity_; }
float operator () (float x);
std::vector<float> getCurvature() const {return curvature_;}
void setCurvature(std::vector<float> curvature);
void setValues(std::vector<float> values, bool recompute = true);
std::vector<float> getValues() const {return sample_values_;}
std::vector<float> getPositions() const {return sample_positions_;}
void setPositions(std::vector<float> positions, bool recompute = true);
void setDefaultValue(float value) {default_value_ = value;}
float getDefaultValue() const {return default_value_;}
void setLowerBound(float lb) {lower_bound_ = lb;}
void setUpperBound(float ub) {upper_bound_ = ub;}
float getLowerBound() const {return lower_bound_;}
float getUpperBound() const {return upper_bound_;}
bool isNatural() const {return is_natural_;}
void makeNatural(bool recompute = true);
void setBoudaryDerivatives(float lower_derivative, float upper_derivative, bool recompute = true);
void setLowerDerivative(float derivative, bool recompute = true);
float getLowerDerivative() const {return lower_derivative_;}
void setUpperDerivative(float derivative, bool recompute = true);
float getUpperDerivative() const {return upper_derivative_;}
private :
void createSpline();
// Sample positions of the spline.
std::vector<float> sample_positions_;
// Sample values of the spline.
std::vector<float> sample_values_;
// Curvature of the spline.
std::vector<float> curvature_;
// Flag to denote, if the default values should be set to the average
bool return_average_;
float default_value_;
// Lower bound of the spline
float lower_bound_;
// Upper bound of the spline
float upper_bound_;
// Flag to denote, if the spline is natural
bool is_natural_;
// Value of the first derivative of the lower sample position
float lower_derivative_;
// Value of the first derivative of the upper sample position
float upper_derivative_;
int verbosity_;
};
}
#endif
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::CubicSpline1D::isNatural
bool isNatural() const
Definition cubicSpline1D.h:195
BALL::CubicSpline1D::getVerbosity
int getVerbosity() const
Definition cubicSpline1D.h:134
BALL::CubicSpline1D::setBoudaryDerivatives
void setBoudaryDerivatives(float lower_derivative, float upper_derivative, bool recompute=true)
BALL::CubicSpline1D::setLowerDerivative
void setLowerDerivative(float derivative, bool recompute=true)
BALL::CubicSpline1D::setValues
void setValues(std::vector< float > values, bool recompute=true)
BALL::CubicSpline1D::setLowerBound
void setLowerBound(float lb)
Definition cubicSpline1D.h:186
BALL::CubicSpline1D::setPositions
void setPositions(std::vector< float > positions, bool recompute=true)
BALL::CubicSpline1D::VERBOSITY_LEVEL_DEBUG
static const int VERBOSITY_LEVEL_DEBUG
Definition cubicSpline1D.h:22
BALL::CubicSpline1D::getUpperDerivative
float getUpperDerivative() const
Definition cubicSpline1D.h:226
BALL::CubicSpline1D::setUpperBound
void setUpperBound(float ub)
Definition cubicSpline1D.h:187
BALL::CubicSpline1D::makeNatural
void makeNatural(bool recompute=true)
BALL::CubicSpline1D::setDefaultValue
void setDefaultValue(float value)
Definition cubicSpline1D.h:179
BALL::CubicSpline1D::getUpperBound
float getUpperBound() const
Definition cubicSpline1D.h:192
BALL::CubicSpline1D::getCurvature
std::vector< float > getCurvature() const
Definition cubicSpline1D.h:147
BALL::CubicSpline1D::setUpperDerivative
void setUpperDerivative(float derivative, bool recompute=true)
BALL::CubicSpline1D::getLowerDerivative
float getLowerDerivative() const
Definition cubicSpline1D.h:216
BALL::CubicSpline1D::getPositions
std::vector< float > getPositions() const
Definition cubicSpline1D.h:169
BALL::CubicSpline1D::setCurvature
void setCurvature(std::vector< float > curvature)
BALL::CubicSpline1D::getValues
std::vector< float > getValues() const
Definition cubicSpline1D.h:165
BALL::CubicSpline1D::setVerbosity
void setVerbosity(int verbosity)
Definition cubicSpline1D.h:131
BALL::CubicSpline1D::VERBOSITY_LEVEL_CRITICAL
static const int VERBOSITY_LEVEL_CRITICAL
Definition cubicSpline1D.h:23
BALL::CubicSpline1D::getDefaultValue
float getDefaultValue() const
Definition cubicSpline1D.h:180
BALL::CubicSpline1D::getLowerBound
float getLowerBound() const
Definition cubicSpline1D.h:191
BALL::CubicSpline1D::CubicSpline1D
CubicSpline1D()
common.h
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
BALL
Definition constants.h:13
std
STL namespace.
options.h