BALL::PiecewiseFunction Class Reference

Piecewise function object. More...

#include <piecewiseFunction.h>

Inheritance diagram for BALL::PiecewiseFunction:
Inheritance graph
[legend]

List of all members.


Public Member Functions

Constructors and Destructors
PiecewiseFunction ()
Default constructor.
PiecewiseFunction (const PiecewiseFunction &function)
Copy constructor.
PiecewiseFunction (const std::vector< Interval > &intervals, const std::vector< Coefficients > &coeffs)
Detailed constructor.
virtual ~PiecewiseFunction ()
Destructor.
Assignment
PiecewiseFunction & operator= (const PiecewiseFunction &function)
Assignemnt operator.
void clear ()
Clear function.
Accessors
void setIntervals (const std::vector< Interval > &intervals)
Set the intervals for the piecewise definition.
const std::vector< Interval > & getIntervals () const
Get all the intervals.
const Interval & getInterval (double x) const throw (Exception::OutOfRange)
Get the interval a given x belongs to.
const Interval & getInterval (Position index) const throw (Exception::IndexOverflow)
Get interval limits by index.
Position getIntervalIndex (double x) const throw (Exception::OutOfRange)
Get the interval index for a given x.
const Interval & getRange () const
Return the range of the definition.
void setCoefficients (const vector< Coefficients > &coefficients)
Set the coefficients.
const std::vector< Coefficients > & getCoefficients () const
const Coefficients & getCoefficients (double x) const throw (Exception::OutOfRange)
Get the coefficients for a given x.
const Coefficients & getCoefficients (Position index) const throw (Exception::IndexOverflow)
get coefficients from index
virtual double operator() (double x) const
compute the value of the piecewise function data for a given x
void set (const std::vector< Interval > &intervals, const std::vector< Coefficients > &coeffs)
Predicates
bool isInRange (double x) const
Check whether a given x is in the range of definition.
virtual bool isValid () const
check validity of the definition
bool operator== (const PiecewiseFunction &function) const
Equality operator.
Debugging and Diagnostics
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
Dumps the whole content of the object.

Protected Attributes

std::vector< Interval > intervals_
std::vector< Coefficients > coefficients_
bool valid_

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.

Member Function Documentation

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.


Generated on Thu Aug 6 18:30:35 2009 for BALL by doxygen 1.5.8