procedure WeightsGauss(NumPoints: Integer; const Points: TVec; const Weights: TVec; const FloatPrecision: TMtxFloatPrecision);
Gauss base points and weights.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | NumPoints | Integer | |
| 2 | Points | TVec | |
| 3 | Weights | TVec | |
| 4 | FloatPrecision | TMtxFloatPrecision |
Result: stored in self (calling object)
Remarks:
Calculates base points and weight factors by using the so called Gauss algorithm given by Davis and Rabinowitz in 'Methods of Numerical Integration', page 365, Academic Press, 1975.
Examples
// Integrating function
function IntFunc(const Parameters: TVec; Const Constants: TVec; const ObjConst: Array of TObject): double;
var x: double;
begin
x := Parameters[0];
IntFunc := Sin(x);
end;
// Integrate
procedure DoIntegrate;
var bpoints,weights: Vector;
area: double;
begin
WeightsGauss(10,bpoints,weights);
area := QuadGauss(IntFunc,0,PI,bpoints,weights,1);
end;