Static Public Member Functions

zeus::TCalculusHelper Class Reference

#include <CalculusHelper.h>

List of all members.

Static Public Member Functions

static Float evalFunction (RealRealFunction pFunction, const Float &x, Int n=0)
 Evaluate a real real function of the form y = f(x) at position x.
static Float calcDerivative (RealRealFunction pFunction, const Float &x, Int n=1)
 Numerically approximate the n-th derivative f(n)(x) of a real real function.
static Float integrate (RealRealFunction pFunction, const Float &x1, const Float &x2, bool bIntegrateAbsolutely=false, Int iIntervals=10000)
 Numerically integrate a real real function of the form y = f(x).

Detailed Description

TCalculusHelper is a static class encapsulating numerical calculus of real real functions, such as derivatives and integration.


Member Function Documentation

Float zeus::TCalculusHelper::calcDerivative ( RealRealFunction  pFunction,
const Float &  x,
Int  n = 1 
) [static]

Numerically approximate the n-th derivative f(n)(x) of a real real function.

Numerically approximate the n-th derivative f(n)(x) of a real real function of the form

y = f(x)

at position x.

Parameters:
pFunction[IN]: Pointer to a real real function.
x[IN]: x value for which f(n)(x) is to be calculated.
n[IN]: Order of the derivative.
Returns:
: n-th derivative f(n)(x).
Float zeus::TCalculusHelper::evalFunction ( RealRealFunction  pFunction,
const Float &  x,
Int  n = 0 
) [static]

Evaluate a real real function of the form y = f(x) at position x.

Evaluate a real real function of the form

y = f(x)

at position x.

Parameters:
pFunction[IN]: Pointer to a real real function.
x[IN]: x value for which f(x) is to be calculated.
n[IN]: Order of the derivative. Unused.
Returns:
: First derivative f(x).
Float zeus::TCalculusHelper::integrate ( RealRealFunction  pFunction,
const Float &  x1,
const Float &  x2,
bool  bIntegrateAbsolutely = false,
Int  iIntervals = 10000 
) [static]

Numerically integrate a real real function of the form y = f(x).

Numerically integrate a real real function of the form

y = f(x)

from position x1 to position x2.

Parameters:
pFunction[IN]: Pointer to a real real function.
x1[IN]: Start position of the integration interval.
x2[IN]: End position of the integration interval.
bIntegrateAbsolutely[IN]: If true, |f(x)| is integrated instead of f(x).
iIntervals[IN]: Number of intervals for the numerical integration. A higher number implies higher precision, but longer calculation time.

Use a value of 1 for linear functions.

Returns:
: Integration(f(x), x = x1..x2).

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:32:26