void WeightsGauss(int NumPoints, TVec *Points, TVec *Weights, const TMtxFloatPrecision FloatPrecision = TMtxFloatPrecision::mvDouble);
Gauss base points and weights.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | NumPoints | int | |
| 2 | Points | TVec * | |
| 3 | Weights | TVec * | |
| 4 | FloatPrecision = TMtxFloatPrecision::mvDouble | const TMtxFloatPrecision |
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
#include "MtxExpr.h"
#include "MtxVec.h"
#include "Units.Math387.h"
#include "Units.MtxIntDiff.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units;
using namespace Dew::Math::Units::Math387;
static double IntFun(TVec* Parameters, TVec* c, const DewArray<tObject*>& o)
{
double x = (*Parameters)[0];
return Sin(x)*Exp(-x*x);
}
void Example()
{
Vector bpoints(0);
Vector weights(0);
MtxIntDiff::WeightsGauss(10, bpoints, weights);
double area = MtxIntDiff::QuadGauss(IntFun, -0.5*PI, PI, bpoints, weights, 64);
}
Declared in Dew::Math::Units::MtxIntDiff · Dew.Math/Units.MtxIntDiff.h · Cross-compiler