double MonteCarlo(TRealFunction Fun, double lb, double ub, const TMtxFloatPrecision FloatPrecision, TVec *Constants, const DewArray<tObject *> &ObjConst, int N = 65536);
Numerical integration by Monte Carlo method.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Fun | TRealFunction | Integrating function. |
| 2 | lb | double | Defines lower bound. |
| 3 | ub | double | Defines pper bound. |
| 4 | FloatPrecision | const TMtxFloatPrecision | Defines the computational precision to be used by the routine. |
| 5 | Constants | TVec * | Additional constants defining Fun function, usually nil/null. |
| 6 | ObjConst | const DewArray<tObject *> & | Additional objects defining Fun function, usually nil/null. |
| 7 | N = 65536 | int | Number of random points in [lb,ub] interval (see comments above). |
Returns: the numerical approximate on integral of function Fun between limits lb and ub.
Remarks:
Performs a numerical integration of function of single variable by using Monte Carlo method.
See Also: MtxIntDiff::QuadGauss
Declared in Dew::Math::Units::MtxIntDiff · Dew.Math/Units.MtxIntDiff.h · Cross-compiler