Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

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

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

#include <rombergIntegrator.h>

Inheritance diagram for RombergIntegrator< Function, DataType >:

NumericalIntegrator< Function, DataType > List of all members.

Public Member Functions

Constructors and destructor.
 RombergIntegrator (float epsilon=1E-5, Size nsteps=1000) throw ()
 Default constructor.
 RombergIntegrator (const RombergIntegrator &romint) throw ()
 Copy constructor.
 ~RombergIntegrator () throw ()
 Destructor.
Assignment
const RombergIntegratoroperator= (const RombergIntegrator &romint) throw ()
 Assignment operator.
virtual void clear () throw ()
 Clear method.
void setEpsilon (float eps) throw ()
 Set the upper bound for the error we want to allow.
void setMaxNumSteps (Size mns) throw ()
 Set the maximum number of steps we want to use in computation.
Predicates
bool operator== (const RombergIntegrator &romint) const throw ()
 Equality operator.
Accessors
DataType integrate (DataType from, DataType to) throw ()
 Integrate the function numerically.
DataType trapezoid (DataType h, DataType from, DataType to) throw ()
 Integrate the function numerically using a simple trapezoid integration.

Protected Attributes

float epsilon_
Size maxNumSteps_
vector< DataType > result_

Detailed Description

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

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


Member Function Documentation

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

Integrate the function numerically.

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

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

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