#include <rombergIntegrator.h>
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 RombergIntegrator & | operator= (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) |
Integrate the function numerically.
|
|
DataType | trapezoid (DataType h, DataType from, DataType to) |
Integrate the function numerically
using a simple trapezoid integration. |
|
Protected Attributes |
|
float | epsilon_ |
Size | maxNumSteps_ |
vector< DataType > | result_ |
DataType BALL::RombergIntegrator< Function, DataType >::integrate | ( | DataType | from, | |
DataType | to | |||
) |
Integrate the function numerically.
from | lower limit of the integration | |
to | upper limit of the integration |
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.
h | gives the width of each step | |
from | lower limit of the integration | |
to | upper limit of the integration |