b311480e |
1 | -- Created on: 1991-07-19 |
2 | -- Created by: Isabelle GRIGNON |
3 | -- Copyright (c) 1991-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | -- by the Free Software Foundation, with special exception defined in the file |
11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | private class MyRootFunction from CPnts |
18 | |
19 | inherits FunctionWithDerivative from math |
20 | |
21 | ---Purpose: Implements a function for the Newton algorithm to find the |
22 | -- solution of Integral(F) = L |
ff8178ef |
23 | -- (compute Length and Derivative of the curve for Newton) |
7fd59977 |
24 | |
25 | uses |
26 | MyGaussFunction from CPnts, |
27 | RealFunction from CPnts |
28 | |
29 | is |
30 | |
31 | Create returns MyRootFunction from CPnts; |
32 | ---C++: inline |
33 | |
34 | Init(me : in out; |
35 | F : RealFunction from CPnts; |
36 | D : Address from Standard; |
37 | Order : Integer); |
38 | ---Purpose: F is a pointer on a function D is a client data |
39 | -- Order is the order of integration to use |
40 | -- |
41 | |
42 | Init(me : in out; X0,L : Real); |
43 | ---Purpose: We want to solve Integral(X0,X,F(X,D)) = L |
44 | |
45 | Init(me : in out; X0,L,Tol : Real); |
46 | ---Purpose: We want to solve Integral(X0,X,F(X,D)) = L |
47 | -- with given tolerance |
48 | |
49 | Value(me:in out; X : Real; F : out Real) |
50 | ---Purpose: This is Integral(X0,X,F(X,D)) - L |
51 | returns Boolean |
52 | is static; |
53 | |
54 | Derivative(me :in out; X: Real; Df : out Real) |
55 | ---Purpose: This is F(X,D) |
56 | returns Boolean |
57 | is static; |
58 | |
59 | Values(me:in out; X : Real; F, Df : out Real) |
60 | returns Boolean |
61 | is static; |
62 | |
63 | fields |
64 | myFunction : MyGaussFunction from CPnts; |
65 | myX0 : Real; |
66 | myL : Real; |
67 | myOrder : Integer; |
68 | myTol : Real; -- rbv's modification |
69 | end MyRootFunction; |