You are here: Symbol Reference > MtxIntDiff Namespace > Functions > MtxIntDiff.QuadGauss Function
MtxVec VCL
ContentsIndex
Example

Evaluate fuction Sin(x)*Exp(-x^2) on interval [-PI/2, PI]. Use default Gauss base points and weights.

Uses Math387, MtxIntDiff; // 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)*Exp(-x*x); end; // Integrate procedure DoIntegrate; var area: double; sr: TIntStopReason; begin area := QuadGauss(IntFunc,-0.5*PI,PI,sr); end;

 

#include "MtxExpr.hpp" #include "Math387.hpp" #include "MtxIntDiff.hpp" // Integrating function double __fastcall IntFun(TVec* const Parameters, TVec* const Constants, System::TObject* const * ObjConst, const int ObjConst_Size) { double x = (*Parameters)[0]; return Math.Sin(x)*Math.Exp(-x*x); } void __fastcall Example(); { TIntStopReason sr; double area = QuadGauss(IntFun,0.0,5*PI,sr); }
Copyright (c) 1999-2025 by Dew Research. All rights reserved.