MtxIntDiff.Romberg Method

Double Romberg(TRealFunction Fun, Double lb, Double ub, TMtxFloatPrecision FloatPrecision, TVec Constants, Object[] ObjConst, ref TIntStopReason StopReason, Double Tolerance, Int32 MaxIter)

Numerical integration by using recursive Romberg algorithm.

#NameDescription
1FunIntegrating function.
2ConstantsAdditional constants defining Fun function, usually nil/null.
3ObjConstAdditional objects defining Fun function, usually nil/null.
4lbDefines lower bound.
5ubDefines upper bound.
6StopReasonReturns algorithm stop reason.
7ToleranceDefines integration tolerance.
8MaxIterDefines maximum number of alorithm iterations.
9FloatPrecisionDefines the computational precision to be used by the routine.

Returns: Double - the numerical approximate on integral of function Fun between limits lb and ub.

Examples
private double IntFun(TVec x, TVec c, params object[] o)
{
    double x = x[0];
    return System.Math.Sin(x)*System.Math.Exp(-x*x);
}
private void Example()
{
    TIntStopReason sr;
    double area = MtxIntDif.Romberg(IntFun,0.0,5*System.Math.PI,out sr, 1.0e-4, 100);
}
See Also: MtxIntDiff.QuadGauss