0023830: BRepExtrema_DistShapeShape does not find intersection of face with edge
[occt.git] / src / math / math_BracketMinimum.cdl
1 -- Created on: 1991-05-14
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22
23
24 class BracketMinimum from math
25         ---Purpose:Given two distinct initial points, BracketMinimum
26         -- implements the computation of three points (a, b, c) which
27         -- bracket the minimum of the function and verify A less than
28         -- B, B less than C and F(A) less than F(B), F(B) less than (C).
29 uses Vector from math, 
30      Matrix from math, 
31      Function from math,
32      OStream from Standard
33
34 raises NotDone from StdFail
35
36 is
37
38
39     Create(F: in out Function; A, B: Real)
40         ---Purpose:
41         -- Given two initial values this class computes a
42         -- bracketing triplet of abscissae Ax, Bx, Cx 
43         -- (such that Bx is between Ax and Cx, F(Bx) is 
44         -- less than both F(Bx) and F(Cx)) the Brent minimization is done 
45         -- on the function F.
46     
47     returns BracketMinimum;
48     
49     Create(F: in out Function; A, B, FA: Real)
50         ---Purpose:
51         -- Given two initial values this class computes a
52         -- bracketing triplet of abscissae Ax, Bx, Cx 
53         -- (such that Bx is between Ax and Cx, F(Bx) is 
54         -- less than both F(Bx) and F(Cx)) the Brent minimization is done 
55         -- on the function F.
56         -- This constructor has to be used if F(A) is known.
57     
58     returns BracketMinimum;
59
60
61     Create(F: in out Function; A, B, FA, FB: Real)
62         ---Purpose:
63         -- Given two initial values this class computes a
64         -- bracketing triplet of abscissae Ax, Bx, Cx 
65         -- (such that Bx is between Ax and Cx, F(Bx) is 
66         -- less than both F(Bx) and F(Cx)) the Brent minimization is done 
67         -- on the function F.
68         -- This constructor has to be used if F(A) and F(B) are known.
69     
70     returns BracketMinimum;
71     
72
73     Perform(me: in out; F: in out Function; A, B: Real)
74         ---Purpose: Is used internally by the constructors.
75
76     is static protected;
77
78
79     IsDone(me)
80         ---Purpose: Returns true if the computations are successful, otherwise returns false.
81         ---C++: inline
82     returns Boolean
83     is static;
84     
85     
86     Values(me; A, B, C: out Real)
87         ---Purpose: Returns the bracketed triplet of abscissae.
88         -- Exceptions
89         -- StdFail_NotDone if the algorithm fails (and IsDone returns false).
90         
91     raises NotDone
92     is static;
93     
94
95
96     FunctionValues(me; FA, FB, FC: out Real)
97         ---Purpose: returns the bracketed triplet function values.
98         -- Exceptions
99         -- StdFail_NotDone if the algorithm fails (and IsDone returns false).
100         
101     raises NotDone
102     is static;
103
104     
105     Dump(me; o: in out OStream)
106         ---Purpose: Prints on the stream o information on the current state 
107         --          of the object.
108         --          Is used to redefine the operator <<.
109
110     is static;
111
112     
113 fields
114
115 Done:     Boolean;
116 Ax:       Real;
117 Bx:       Real;
118 Cx:       Real;
119 FAx:      Real;
120 FBx:      Real;
121 FCx:      Real;
122 myFA:     Boolean;
123 myFB:     Boolean;
124
125 end BracketMinimum;