Overload List
Overload 1: Double QuadGauss(TRealFunction Fun, Double lb, Double ub, ref TIntStopReason StopReason, TMtxFloatPrecision FloatPrecision, TQuadMethod QMethod, Double Tolerance, Int32 MaxIter)
Integration by using Gauss quadrature algorithm with no additional parameters for Fun.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Fun | TRealFunction | |
| 2 | lb | Double | scalar |
| 3 | ub | Double | scalar |
| 4 | StopReason | TIntStopReason (ref) | |
| 5 | FloatPrecision | TMtxFloatPrecision | |
| 6 | QMethod | TQuadMethod | |
| 7 | Tolerance | Double | scalar |
| 8 | MaxIter | Int32 |
Returns: Double - the numerical approximate on integral of function Fun between limits lb and ub.
This version calculates base points and weights on the fly.
Note
Use this overload if integrating function is defined only by double parameter(s).
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.QuadGauss(IntFun,-0.5*System.Math.PI, System.Math.PI, out sr, 1.0e-4, 8);
}
Overload 2: Double QuadGauss(TRealFunction Fun, Double lb, Double ub, TVec BasePoints, TVec Weights, Int32 Parts)
Numerical integration by using regular Gaussian quadrature scheme.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Fun | TRealFunction | |
| 2 | lb | Double | scalar |
| 3 | ub | Double | scalar |
| 4 | BasePoints | TVec | source TVec |
| 5 | Weights | TVec | source TVec |
| 6 | Parts | Int32 |
Returns: Double - the numerical approximate on integral of function Fun between limits lb and ub.
Check the following link to learn more about this algorithm
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()
{
Vector bpoints = new Vector(0);
Vector weights = new Vector(0);
MtxIntDiff.WeightsGauss(10,bpoints,weights);
double area = MtxIntDif.QuadGauss(IntFun,-0.5*System.Math.PI,System.Math.PI,bpoints,weights,64);
}
Overload 3: Double QuadGauss(TRealFunction Fun, Double lb, Double ub, TVec Constants, Object[] ObjConst, ref TIntStopReason StopReason, TMtxFloatPrecision FloatPrecision, TQuadMethod QMethod, Double Tolerance, Int32 MaxIter)
Evaluate the numerical integral between lower and upper bound using Gauss quadrature algorithm.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Fun | TRealFunction | |
| 2 | lb | Double | scalar |
| 3 | ub | Double | scalar |
| 4 | Constants | TVec | source TVec |
| 5 | ObjConst | Object[] | |
| 6 | StopReason | TIntStopReason (ref) | |
| 7 | FloatPrecision | TMtxFloatPrecision | |
| 8 | QMethod | TQuadMethod | |
| 9 | Tolerance | Double | scalar |
| 10 | MaxIter | Int32 |
Returns: Double - the numerical approximate on integral of function Fun between limits lb and ub.
This version calculates base points and weights on the fly.
Overload 4: Double QuadGauss(TRealFunction Fun, Double lb, Double ub, TVec Constants, Object[] ObjConst, TVec BasePoints, TVec Weights, Int32 Parts)
Numerical integration by using regular Gaussian quadrature scheme (Fun defined only with double(s)).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Fun | TRealFunction | |
| 2 | lb | Double | scalar |
| 3 | ub | Double | scalar |
| 4 | Constants | TVec | source TVec |
| 5 | ObjConst | Object[] | |
| 6 | BasePoints | TVec | source TVec |
| 7 | Weights | TVec | source TVec |
| 8 | Parts | Int32 |
Returns: Double