1 -- Created on: 1991-07-25
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.
24 generic class ResolConstraint from AppParCurves
26 ToolLine as any) -- as ToolLine(MultiLine)
29 ---Purpose: This classe describes the algorithm to find the approximate
30 -- solution of a MultiLine with constraints. The resolution
31 -- algorithm is the Uzawa method. See the math package
32 -- for more information.
33 -- All the tangencies of MultiPointConstraint's points
35 -- Be careful of the curvature: it is possible to have some
36 -- curvAature points only for one curve. In this case, the Uzawa
37 -- method is used with a non-linear resolution, much more longer.
40 uses Matrix from math,
42 Array1OfInteger from TColStd,
43 MultiCurve from AppParCurves,
44 HArray1OfConstraintCouple from AppParCurves
47 raises OutOfRange from Standard
51 Create(SSP: MultiLine; SCurv: in out MultiCurve;
52 FirstPoint, LastPoint: Integer;
53 Constraints: HArray1OfConstraintCouple;
54 Bern, DerivativeBern: Matrix; Tolerance: Real = 1.0e-10)
55 ---Purpose: Given a MultiLine SSP with constraints points, this
56 -- algorithm finds the best curve solution to approximate it.
57 -- The poles from SCurv issued for example from the least
58 -- squares are used as a guess solution for the uzawa
59 -- algorithm. The tolerance used in the Uzawa algorithms
61 -- A is the Bernstein matrix associated to the MultiLine
62 -- and DA is the derivative bernstein matrix.(They can come
63 -- from an approximation with ParLeastSquare.)
64 -- The MultiCurve is modified. New MultiPoles are given.
67 returns ResolConstraint from AppParCurves;
71 ---Purpose: returns True if all has been correctly done.
78 ---Purpose: returns the maximum difference value between the curve
79 -- and the given points.
94 ---Purpose: returns the duale variables of the system.
100 ConstraintDerivative(me: in out; SSP: MultiLine; Parameters: Vector;
101 Deg: Integer; DA: Matrix)
102 ---Purpose: Returns the derivative of the constraint matrix.
103 ---C++: return const&
109 ---Purpose: returns the Inverse of Cont*Transposed(Cont), where
110 -- Cont is the constraint matrix for the algorithm.
111 ---C++: return const&
116 NbConstraints(me; SSP: MultiLine; FirstPoint, LastPoint: Integer;
117 TheConstraints: HArray1OfConstraintCouple)
118 ---Purpose: is used internally to create the fields.
124 NbColumns(me; SSP: MultiLine; Deg: Integer)
125 ---Purpose: is internally used for the fields creation.
143 IPas: Array1OfInteger;
144 ITan: Array1OfInteger;
145 ICurv: Array1OfInteger;