MtxIntDiff::WeightsGauss Function

void WeightsGauss(int NumPoints, TVec *Points, TVec *Weights, const TMtxFloatPrecision FloatPrecision = TMtxFloatPrecision::mvDouble);

Gauss base points and weights.

#NameTypeDescription
1NumPointsint
2PointsTVec *
3WeightsTVec *
4FloatPrecision = TMtxFloatPrecision::mvDoubleconst 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);
}
See Also: MtxIntDiff::WeightsChebyshevGauss, MtxIntDiff::WeightsNewtonCotes
Declared in Dew::Math::Units::MtxIntDiff · Dew.Math/Units.MtxIntDiff.h · Cross-compiler