1 -- Created on: 1991-08-22
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
26 ---Purpose: This class implements a system resolution C*X = B with
27 -- an approach solution X0. There are no conditions on the
28 -- number of equations. The algorithm used is the Uzawa
29 -- algorithm. It is possible to have equal or inequal (<)
30 -- equations to solve. The resolution is done with a
31 -- minimization of Norm(X-X0).
32 -- If there are only equal equations, the resolution is directly
33 -- done and is similar to Gauss resolution with an optimisation
34 -- because the matrix is a symmetric matrix.
35 -- (The resolution is done with Crout algorithm)
39 uses Matrix from math,
43 raises NotDone from StdFail,
44 ConstructionError from Standard
48 Create(Cont: Matrix; Secont, StartingPoint: Vector;
49 EpsLix: Real = 1.0e-06; EpsLic: Real = 1.0e-06;
50 NbIterations: Integer = 500)
51 ---Purpose: Given an input matrix Cont, two input vectors Secont
52 -- and StartingPoint, it solves Cont*X = Secont (only
53 -- = equations) with a minimization of Norme(X-X0).
54 -- The maximun iterations number allowed is fixed to
56 -- The tolerance EpsLic is fixed for the dual variable
57 -- convergence. The tolerance EpsLix is used for the
59 -- Exception ConstuctionError is raised if the line number
60 -- of Cont is different from the length of Secont.
63 raises ConstructionError;
66 Create(Cont: Matrix; Secont, StartingPoint: Vector; Nci, Nce: Integer;
67 EpsLix: Real = 1.0e-06; EpsLic: Real = 1.0e-06;
68 NbIterations: Integer = 500)
69 ---Purpose: Given an input matrix Cont, two input vectors Secont
70 -- and StartingPoint, it solves Cont*X = Secont (the Nce
71 -- first equations are equal equations and the Nci last
72 -- equations are inequalities <) with a minimization
74 -- The maximun iterations number allowed is fixed to
76 -- The tolerance EpsLic is fixed for the dual variable
77 -- convergence. The tolerance EpsLix is used for the
79 -- There are no conditions on Nce and Nci.
80 -- Exception ConstuctionError is raised if the line number
81 -- of Cont is different from the length of Secont and from
85 raises ConstructionError;
88 Perform(me: in out; Cont: Matrix; Secont, StartingPoint: Vector;
89 Nci, Nce: Integer; EpsLix: Real = 1.0e-06;
90 EpsLic: Real = 1.0e-06; NbIterations: Integer = 500)
91 ---Purpose: Is used internally by the two constructors above.
97 ---Purpose: Returns true if the computations are successful, otherwise returns false.
104 ---Purpose: Returns the vector solution of the system above.
105 -- An exception is raised if NotDone.
107 ---C++: return const&
114 ---Purpose: Returns the initial error Cont*StartingPoint-Secont.
115 -- An exception is raised if NotDone.
117 ---C++: return const&
123 Duale(me; V : out Vector)
124 ---Purpose: returns the duale variables V of the systeme.
131 ---Purpose: Returns the difference between X solution and the
133 -- An exception is raised if NotDone.
135 ---C++: return const&
142 ---Purpose: returns the number of iterations really done.
143 -- An exception is raised if NotDone.
151 ---Purpose: returns the inverse matrix of (C * Transposed(C)).
152 -- This result is needed for the computation of the gradient
153 -- when approximating a curve.
155 ---C++: return const&
161 Dump(me; o: in out OStream)
162 ---Purpose: Prints information on the current state of the object.