BALL
1.4.2
|
#include <BALL/MATHS/piecewiseFunction.h>
Public Member Functions | |
Constructors and Destructors | |
PiecewiseFunction () | |
PiecewiseFunction (const PiecewiseFunction &function) | |
PiecewiseFunction (const std::vector< Interval > &intervals, const std::vector< Coefficients > &coeffs) | |
virtual | ~PiecewiseFunction () |
Assignment | |
PiecewiseFunction & | operator= (const PiecewiseFunction &function) |
void | clear () |
Accessors | |
void | setIntervals (const std::vector< Interval > &intervals) |
const std::vector< Interval > & | getIntervals () const |
const Interval & | getInterval (double x) const |
const Interval & | getInterval (Position index) const |
Position | getIntervalIndex (double x) const |
const Interval & | getRange () const |
void | setCoefficients (const vector< Coefficients > &coefficients) |
const std::vector< Coefficients > & | getCoefficients () const |
const Coefficients & | getCoefficients (double x) const |
const Coefficients & | getCoefficients (Position index) const |
virtual double | operator() (double x) const |
void | set (const std::vector< Interval > &intervals, const std::vector< Coefficients > &coeffs) |
Predicates | |
bool | isInRange (double x) const |
virtual bool | isValid () const |
bool | operator== (const PiecewiseFunction &function) const |
Debugging and Diagnostics | |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const |
Protected Attributes | |
std::vector< Interval > | intervals_ |
std::vector< Coefficients > | coefficients_ |
bool | valid_ |
Private Member Functions | |
void | calculateRange () |
Private Attributes | |
Interval | range_ |
Piecewise function object. This class provides the interface for piecewise functions needed as representation of radial distribution functions (
Function
interface.Definition at line 34 of file piecewiseFunction.h.
BALL::PiecewiseFunction::PiecewiseFunction | ( | ) |
Default constructor
BALL::PiecewiseFunction::PiecewiseFunction | ( | const PiecewiseFunction & | function | ) |
Copy constructor
BALL::PiecewiseFunction::PiecewiseFunction | ( | const std::vector< Interval > & | intervals, |
const std::vector< Coefficients > & | coeffs | ||
) |
Detailed constructor
|
virtual |
Destructor
|
private |
void BALL::PiecewiseFunction::clear | ( | ) |
Clear function
|
virtual |
Dumps the whole content of the object
Reimplemented in BALL::PiecewisePolynomial.
const std::vector<Coefficients>& BALL::PiecewiseFunction::getCoefficients | ( | ) | const |
const Coefficients& BALL::PiecewiseFunction::getCoefficients | ( | double | x | ) | const |
Get the coefficients for a given x
Exception::OutOfRange | if x is out of range |
const Coefficients& BALL::PiecewiseFunction::getCoefficients | ( | Position | index | ) | const |
Get the coefficients from index
Exception::IndexOverflow | if index >= intervals_.size() |
Get the interval a given x belongs to
Exception::OutOfRange | if x is out of range |
Get interval limits by index
Exception::IndexOverflow | if index >= intervals_.size() |
Get the interval index for a given x
Exception::OutOfRange | if x is out of range |
const std::vector<Interval>& BALL::PiecewiseFunction::getIntervals | ( | ) | const |
Get all the intervals
const Interval& BALL::PiecewiseFunction::getRange | ( | ) | const |
Return the range of the definition
Check whether a given x is in the range of definition
|
virtual |
check validity of the definition
compute the value of the piecewise function data for a given x
Reimplemented in BALL::PiecewisePolynomial.
PiecewiseFunction& BALL::PiecewiseFunction::operator= | ( | const PiecewiseFunction & | function | ) |
Assignemnt operator
bool BALL::PiecewiseFunction::operator== | ( | const PiecewiseFunction & | function | ) | const |
Equality operator
void BALL::PiecewiseFunction::set | ( | const std::vector< Interval > & | intervals, |
const std::vector< Coefficients > & | coeffs | ||
) |
void BALL::PiecewiseFunction::setCoefficients | ( | const vector< Coefficients > & | coefficients | ) |
Set the coefficients. Note that this method does not check the vector of coefficients for sanity.
void BALL::PiecewiseFunction::setIntervals | ( | const std::vector< Interval > & | intervals | ) |
Set the intervals for the piecewise definition. Note that this method does not check the definition of the intervals for sanity.
|
protected |
Definition at line 171 of file piecewiseFunction.h.
|
protected |
Definition at line 167 of file piecewiseFunction.h.
|
private |
Definition at line 180 of file piecewiseFunction.h.
|
protected |
Definition at line 173 of file piecewiseFunction.h.