BALL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Protected Attributes | Private Member Functions | Private Attributes
BALL::PiecewiseFunction Class Reference

#include <BALL/MATHS/piecewiseFunction.h>

Inheritance diagram for BALL::PiecewiseFunction:
BALL::PiecewisePolynomial

List of all members.

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
PiecewiseFunctionoperator= (const PiecewiseFunction &function)
void clear ()
Accessors
void setIntervals (const std::vector< Interval > &intervals)
const std::vector< Interval > & getIntervals () const
const IntervalgetInterval (double x) const
const IntervalgetInterval (Position index) const
Position getIntervalIndex (double x) const
const IntervalgetRange () const
void setCoefficients (const vector< Coefficients > &coefficients)
const std::vector< Coefficients > & getCoefficients () const
const CoefficientsgetCoefficients (double x) const
const CoefficientsgetCoefficients (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< Intervalintervals_
std::vector< Coefficientscoefficients_
bool valid_

Private Member Functions

void calculateRange ()

Private Attributes

Interval range_

Detailed Description

Piecewise function object. This class provides the interface for piecewise functions needed as representation of radial distribution functions (

See also:
RadialDistributionFunction). It implements the Function interface.
Note that intervals must be disjunct and interval limits have to meet. We require the intervals to be sorted such that the lowest interval limit is the first interval of the vector.

Definition at line 40 of file piecewiseFunction.h.


Constructor & Destructor Documentation

Default constructor

Copy constructor

BALL::PiecewiseFunction::PiecewiseFunction ( const std::vector< Interval > &  intervals,
const std::vector< Coefficients > &  coeffs 
)

Detailed constructor

Destructor


Member Function Documentation

Clear function

Reimplemented in BALL::PiecewisePolynomial.

virtual void BALL::PiecewiseFunction::dump ( std::ostream &  s = std::cout,
Size  depth = 0 
) const [virtual]

Dumps the whole content of the object

Reimplemented in BALL::PiecewisePolynomial.

Get the coefficients for a given x

Exceptions:
Exception::OutOfRangeif x is out of range

Get the coefficients from index

Exceptions:
Exception::IndexOverflowif index >= intervals_.size()

Get the interval a given x belongs to

Exceptions:
Exception::OutOfRangeif x is out of range

Get interval limits by index

Exceptions:
Exception::IndexOverflowif index >= intervals_.size()

Get the interval index for a given x

Exceptions:
Exception::OutOfRangeif x is out of range
const std::vector<Interval>& BALL::PiecewiseFunction::getIntervals ( ) const

Get all the intervals

Return the range of the definition

Check whether a given x is in the range of definition

virtual bool BALL::PiecewiseFunction::isValid ( ) const [virtual]

check validity of the definition

virtual double BALL::PiecewiseFunction::operator() ( double  x) const [virtual]

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.


Member Data Documentation

Definition at line 177 of file piecewiseFunction.h.

Definition at line 173 of file piecewiseFunction.h.

Definition at line 186 of file piecewiseFunction.h.

Definition at line 179 of file piecewiseFunction.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines