1 -- File: MyRootFunction.cdl
2 -- Created: Fri Jul 19 16:11:34 1991
3 -- Author: Isabelle GRIGNON
5 ---Copyright: Matra Datavision 1991
8 private class MyRootFunction from CPnts
10 inherits FunctionWithDerivative from math
12 ---Purpose: Implements a function for the Newton algorithm to find the
13 -- solution of Integral(F) = L
16 MyGaussFunction from CPnts,
17 RealFunction from CPnts
21 Create returns MyRootFunction from CPnts;
25 F : RealFunction from CPnts;
26 D : Address from Standard;
28 ---Purpose: F is a pointer on a function D is a client data
29 -- Order is the order of integration to use
32 Init(me : in out; X0,L : Real);
33 ---Purpose: We want to solve Integral(X0,X,F(X,D)) = L
35 Init(me : in out; X0,L,Tol : Real);
36 ---Purpose: We want to solve Integral(X0,X,F(X,D)) = L
37 -- with given tolerance
39 Value(me:in out; X : Real; F : out Real)
40 ---Purpose: This is Integral(X0,X,F(X,D)) - L
44 Derivative(me :in out; X: Real; Df : out Real)
45 ---Purpose: This is F(X,D)
49 Values(me:in out; X : Real; F, Df : out Real)
54 myFunction : MyGaussFunction from CPnts;
58 myTol : Real; -- rbv's modification