BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Protected Attributes | List of all members
BALL::RombergIntegrator< Function, DataType > Class Template Reference

#include <BALL/MATHS/rombergIntegrator.h>

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

Public Member Functions

Constructors and destructor.
 RombergIntegrator (float epsilon=1E-5, Size nsteps=1000)
 Default constructor. More...
 
 RombergIntegrator (const RombergIntegrator &romint)
 Copy constructor. More...
 
 ~RombergIntegrator ()
 Destructor. More...
 
Assignment
const RombergIntegratoroperator= (const RombergIntegrator &romint)
 Assignment operator. More...
 
virtual void clear ()
 Clear method. More...
 
void setEpsilon (float eps)
 Set the upper bound for the error we want to allow. More...
 
void setMaxNumSteps (Size mns)
 Set the maximum number of steps we want to use in computation. More...
 
Predicates
bool operator== (const RombergIntegrator &romint) const
 Equality operator. More...
 
Accessors
DataType integrate (DataType from, DataType to)
 
DataType trapezoid (DataType h, DataType from, DataType to)
 
- Public Member Functions inherited from BALL::NumericalIntegrator< Function, DataType >
 NumericalIntegrator ()
 Default constructor. More...
 
 NumericalIntegrator (const NumericalIntegrator &nint)
 Copy constructor. More...
 
virtual ~NumericalIntegrator ()
 Destructor. More...
 
NumericalIntegratoroperator= (const NumericalIntegrator &nint)
 Assignment operator. More...
 
bool operator== (const NumericalIntegrator &nint) const
 Equality operator. More...
 
void setFunction (const Function &function)
 
const Function & getFunction () const
 
Function & getFunction ()
 
DataType getValue (const DataType &x) const
 
DataType integrate (const DataType &from, const DataType &to) const
 

Protected Attributes

float epsilon_
 
Size maxNumSteps_
 
vector< DataType > result_
 
- Protected Attributes inherited from BALL::NumericalIntegrator< Function, DataType >
Function function_
 

Detailed Description

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

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

Definition at line 20 of file rombergIntegrator.h.

Constructor & Destructor Documentation

template<typename Function , typename DataType >
BALL_INLINE BALL::RombergIntegrator< Function, DataType >::RombergIntegrator ( float  epsilon = 1E-5,
Size  nsteps = 1000 
)

Default constructor.

Definition at line 95 of file rombergIntegrator.h.

template<typename Function , typename DataType >
BALL_INLINE BALL::RombergIntegrator< Function, DataType >::RombergIntegrator ( const RombergIntegrator< Function, DataType > &  romint)

Copy constructor.

Definition at line 102 of file rombergIntegrator.h.

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

Destructor.

Definition at line 108 of file rombergIntegrator.h.

Member Function Documentation

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

Clear method.

Definition at line 127 of file rombergIntegrator.h.

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

Integrate the function numerically.

Parameters
fromlower limit of the integration
toupper limit of the integration
Returns
the value of the integral

Definition at line 183 of file rombergIntegrator.h.

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

Assignment operator.

Definition at line 116 of file rombergIntegrator.h.

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

Equality operator.

Definition at line 150 of file rombergIntegrator.h.

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

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

Definition at line 134 of file rombergIntegrator.h.

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

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

Definition at line 141 of file rombergIntegrator.h.

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

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
hgives the width of each step
fromlower limit of the integration
toupper limit of the integration
Returns
the value of the integral

Definition at line 161 of file rombergIntegrator.h.

Member Data Documentation

template<typename Function, typename DataType>
float BALL::RombergIntegrator< Function, DataType >::epsilon_
protected

Definition at line 88 of file rombergIntegrator.h.

template<typename Function, typename DataType>
Size BALL::RombergIntegrator< Function, DataType >::maxNumSteps_
protected

Definition at line 89 of file rombergIntegrator.h.

template<typename Function, typename DataType>
vector<DataType> BALL::RombergIntegrator< Function, DataType >::result_
protected

Definition at line 90 of file rombergIntegrator.h.