#include <OSD_Timer.hxx>
#include <TDataStd_Name.hxx>
#include <AppCont_Function.hxx>
+#include <math_ComputeKronrodPointsAndWeights.hxx>
#include <limits>
return 0;
}
+static Standard_Integer OCC33048(Draw_Interpretor&, Standard_Integer, const char**)
+{
+ Standard_Real isOK = true;
+ try
+ {
+ // This method uses raw pointers for memory manipulations and not used in OCCT.
+ math_ComputeKronrodPointsAndWeights aCalc(125);
+ isOK = aCalc.IsDone();
+ }
+ catch (...)
+ {
+ isOK = false;
+ }
+
+ if (isOK)
+ std::cout << "OK: Kronrod points and weights are calculated successfully." << std::endl;
+ else
+ std::cout << "Error: Problem occurred during calculation of Kronrod points and weights." << std::endl;
+
+ return 0;
+}
+
//=======================================================================
//function : QACheckBends
//purpose :
"Tests the case when",
__FILE__, OCC33009, group);
+ theCommands.Add("OCC33048",
+ "Kronrod points and weights calculation",
+ __FILE__, OCC33048, group);
+
theCommands.Add("QACheckBends",
"QACheckBends curve [CosMaxAngle [theNbPoints]]",
__FILE__,
aSubDiag(i) = 0.;
}
- // Initialization of temporary data structures.
+ // Algorithm calculates weights and points symmetrically and uses -1 index
+ // by design. Memory corruption is avoided by moving pointer `s` to the
+ // next element and saving original pointer into `ss` for the proper memory
+ // releasing. Similarly, `t` and `tt` are addressed.
Standard_Integer aNd2 = Number/2;
Standard_Real *s = new Standard_Real[aNd2 + 2];
Standard_Real *t = new Standard_Real[aNd2 + 2];