1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <CPnts_MyRootFunction.ixx>
17 #include <Standard_DomainError.hxx>
18 #include <math_GaussSingleIntegration.hxx>
22 void CPnts_MyRootFunction::Init(const CPnts_RealFunction& F,
23 const Standard_Address D,
24 const Standard_Integer Order)
30 void CPnts_MyRootFunction::Init(const Standard_Real X0,
31 const Standard_Real L)
35 myTol = -1; //to supress the tolerance
38 void CPnts_MyRootFunction::Init(const Standard_Real X0,
39 const Standard_Real L,
40 const Standard_Real Tol)
47 Standard_Boolean CPnts_MyRootFunction::Value(const Standard_Real X,
50 math_GaussSingleIntegration Length;
52 if (myTol <= 0) Length = math_GaussSingleIntegration(myFunction, myX0, X, myOrder);
53 else Length = math_GaussSingleIntegration(myFunction, myX0, X, myOrder, myTol);
56 F= Length.Value() - myL;
60 return Standard_False;
64 Standard_Boolean CPnts_MyRootFunction::Derivative(const Standard_Real X,
67 return myFunction.Value(X,Df);
70 Standard_Boolean CPnts_MyRootFunction::Values(const Standard_Real X,
74 math_GaussSingleIntegration Length;
76 if (myTol <= 0) Length = math_GaussSingleIntegration(myFunction, myX0, X, myOrder);
77 else Length = math_GaussSingleIntegration(myFunction, myX0, X, myOrder, myTol);
80 F= Length.Value() - myL;
81 return myFunction.Value(X,Df);
84 return Standard_False;