2 #define No_Standard_RangeError
3 #define No_Standard_OutOfRange
4 #define No_Standard_DimensionError
7 #include <math_GaussSetIntegration.ixx>
9 #include <math_Vector.hxx>
10 #include <math_FunctionSet.hxx>
13 math_GaussSetIntegration::math_GaussSetIntegration(math_FunctionSet& F,
14 const math_Vector& Lower,
15 const math_Vector& Upper,
16 const math_IntegerVector& Order)
17 : Val(1, F.NbEquations()) {
19 Standard_Integer NbEqua = F.NbEquations() , NbVar = F.NbVariables();
21 Standard_Boolean IsOk;
22 math_Vector FVal1(1, NbEqua), FVal2(1, NbEqua), Tval(1, NbVar);
26 Standard_NotImplemented_Raise_if(
27 NbVar != 1 || Order.Value(Order.Lower()) > math::GaussPointsMax(),
28 "GaussSetIntegration ");
31 Done = Standard_False;
33 Standard_Real Xdeb = Lower.Value( Lower.Lower() );
34 Standard_Real Xfin = Upper.Value( Upper.Lower() );
35 Standard_Integer Ordre = Order.Value(Order.Lower());
37 math_Vector GaussP(1, Ordre), GaussW(1, Ordre);
39 // Recuperation des points de Gauss dans le fichier GaussPoints.
40 math::GaussPoints (Ordre, GaussP);
41 math::GaussWeights (Ordre, GaussW);
44 // Changement de variable pour la mise a l'echelle [Lower, Upper] :
45 Xm = 0.5 * (Xdeb + Xfin);
46 Xr = 0.5 * (Xfin - Xdeb);
48 Standard_Integer ind = Ordre/2, ind1 = (Ordre+1)/2;
49 if(ind1 > ind) { // odder case
50 Tval(1) = Xm; // + Xr * GaussP(ind1);
51 IsOk = F.Value(Tval, Val);
59 for (i=1; i<= ind; i++) {
60 Tval(1) = Xm + Xr * GaussP(i);
61 IsOk = F.Value(Tval, FVal1);
63 Tval(1) = Xm - Xr * GaussP(i);
64 IsOk = F.Value(Tval, FVal2);
75 void math_GaussSetIntegration::Dump(Standard_OStream& o) const
77 o <<"math_GaussSetIntegration ";
79 o << " Status = Done \n";
80 o << "Integration Value = " << Val<<"\n";
83 o << "Status = not Done \n";