BALL::RombergIntegrator< Function, DataType > Class Template Reference
[Function classes]

#include <BALL/MATHS/rombergIntegrator.h>

Inheritance diagram for BALL::RombergIntegrator< Function, DataType >:
BALL::NumericalIntegrator< Function, DataType >

List of all members.


Public Member Functions

Constructors and destructor.
 RombergIntegrator (float epsilon=1E-5, Size nsteps=1000)
 

Default constructor.


 RombergIntegrator (const RombergIntegrator &romint)
 

Copy constructor.


 ~RombergIntegrator ()
 

Destructor.


Assignment
const RombergIntegratoroperator= (const RombergIntegrator &romint)
 

Assignment operator.


virtual void clear ()
 

Clear method.


void setEpsilon (float eps)
 

Set the upper bound for the error we want to allow.


void setMaxNumSteps (Size mns)
 

Set the maximum number of steps we want to use in computation.


Predicates
bool operator== (const RombergIntegrator &romint) const
 

Equality operator.


Accessors
DataType integrate (DataType from, DataType to)
DataType trapezoid (DataType h, DataType from, DataType to)

Protected Attributes

float epsilon_
Size maxNumSteps_
vector< DataType > result_

Detailed Description

template<typename Function, typename DataType>
class BALL::RombergIntegrator< Function, DataType >

A numerical integration of a BALL-Function using a Romberg integration scheme.


Constructor & Destructor Documentation

template<typename Function , typename DataType >
BALL_INLINE BALL::RombergIntegrator< Function, DataType >::RombergIntegrator ( float  epsilon = 1E-5,
Size  nsteps = 1000 
) [inline]
template<typename Function , typename DataType >
BALL_INLINE BALL::RombergIntegrator< Function, DataType >::RombergIntegrator ( const RombergIntegrator< Function, DataType > &  romint  )  [inline]

Copy constructor.

template<typename Function , typename DataType >
BALL_INLINE BALL::RombergIntegrator< Function, DataType >::~RombergIntegrator (  )  [inline]

Destructor.


Member Function Documentation

template<typename Function , typename DataType >
BALL_INLINE void BALL::RombergIntegrator< Function, DataType >::clear (  )  [inline, virtual]

Clear method.

template<typename Function , typename DataType >
BALL_INLINE DataType BALL::RombergIntegrator< Function, DataType >::integrate ( DataType  from,
DataType  to 
) [inline]

Integrate the function numerically.

Parameters:
from lower limit of the integration
to upper limit of the integration
Returns:
the value of the integral

References BALL::Constants::h.

template<typename Function , typename DataType >
BALL_INLINE const RombergIntegrator< Function, DataType > & BALL::RombergIntegrator< Function, DataType >::operator= ( const RombergIntegrator< Function, DataType > &  romint  )  [inline]

Assignment operator.

template<typename Function , typename DataType >
BALL_INLINE bool BALL::RombergIntegrator< Function, DataType >::operator== ( const RombergIntegrator< Function, DataType > &  romint  )  const [inline]

Equality operator.

template<typename Function , typename DataType >
BALL_INLINE void BALL::RombergIntegrator< Function, DataType >::setEpsilon ( float  eps  )  [inline]

Set the upper bound for the error we want to allow.

References BALL::RombergIntegrator< Function, DataType >::epsilon_.

template<typename Function , typename DataType >
BALL_INLINE void BALL::RombergIntegrator< Function, DataType >::setMaxNumSteps ( Size  mns  )  [inline]

Set the maximum number of steps we want to use in computation.

References BALL::RombergIntegrator< Function, DataType >::maxNumSteps_, and BALL::RombergIntegrator< Function, DataType >::result_.

template<typename Function , typename DataType >
BALL_INLINE DataType BALL::RombergIntegrator< Function, DataType >::trapezoid ( DataType  h,
DataType  from,
DataType  to 
) [inline]

Integrate the function numerically using a simple trapezoid integration. This function is intended as a helper function for the computation of the romberg integration, but it can be used as a regular integrator as well, if speed is more important than reliability.

Parameters:
h gives the width of each step
from lower limit of the integration
to upper limit of the integration
Returns:
the value of the integral

References BALL::NumericalIntegrator< Function, DataType >::function_.


Member Data Documentation

template<typename Function, typename DataType>
float BALL::RombergIntegrator< Function, DataType >::epsilon_ [protected]
template<typename Function, typename DataType>
vector<DataType> BALL::RombergIntegrator< Function, DataType >::result_ [protected]