0024428: Implementation of LGPL license
[occt.git] / src / AppParCurves / AppParCurves_Function.cdl
CommitLineData
b311480e 1-- Created on: 1991-09-20
2-- Created by: Laurent PAINNOT
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--
973c2be1 8-- This library is free software; you can redistribute it and / or modify it
9-- under the terms of the GNU Lesser General Public version 2.1 as published
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
17generic class Function from AppParCurves (
18 MultiLine as any;
19 ToolLine as any; -- as ToolLine(MultiLine)
20 Squares as any;
21 ResolCons as any)
22
23 inherits MultipleVarFunctionWithGradient from math
24
25 ---Purpose: This function inherits MultipleVarFunctionWithGradient to be
26 -- used in the mathematical algorithm BFGS.
27 -- It computes the value of the function
28 -- F=sum(||Qui - B*Pi||)2 where Pi are Poles of the Bezier curves
29 -- approximating the given MultiLine SSP and ui the parameters
30 -- associated to the points Qi of SSP.
31 -- It also computes the gradient for values ui of the parameter.
32
33
34uses MultiCurve from AppParCurves,
35 HArray1OfConstraintCouple from AppParCurves,
36 Constraint from AppParCurves,
37 Vector from math,
38 Matrix from math,
39 HArray1OfInteger from TColStd
40
41is
42
43 Create(SSP: MultiLine; FirstPoint, LastPoint: Integer;
44 TheConstraints: HArray1OfConstraintCouple;
45 Parameters: Vector; Deg: Integer)
46 ---Purpose: initializes the fields of the function. The approximating
47 -- curve has the desired degree Deg.
48
49 returns Function from AppParCurves;
50
51
52 NbVariables(me)
53 ---Purpose: returns the number of variables of the function. It
54 -- corresponds to the number of MultiPoints.
55
56 returns Integer
57 is static;
58
59
60
61 Perform(me: in out; X: Vector)
62 ---Purpose: this method is used each time Value or Gradient is
63 -- needed.
64
65 is static protected;
66
67
68 Value(me: in out; X: Vector; F: out Real)
69 ---Purpose: this method computes the new approximation of the
70 -- MultiLine
71 -- SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
72 -- point of the MultiLine.
73
74 returns Boolean
75 is static;
76
77
78 Gradient(me: in out; X: Vector; G: out Vector)
79 ---Purpose: returns the gradient G of the sum above for the
80 -- parameters Xi.
81
82 returns Boolean
83 is static;
84
85
86 Values(me: in out; X: Vector; F: out Real; G: out Vector)
87 ---Purpose: returns the value F=sum(||Pui - Bi*Pi||)2.
88 -- returns the value G = grad(F) for the parameters Xi.
89
90 returns Boolean
91 is static;
92
93
94
95 NewParameters(me)
96 ---Purpose: returns the new parameters of the MultiLine.
97 ---C++: return const&
98 returns Vector
99 is static;
100
101
102 CurveValue(me: in out)
103 ---Purpose: returns the MultiCurve approximating the set after
104 -- computing the value F or Grad(F).
105 ---C++: return const&
106 returns MultiCurve from AppParCurves
107 is static;
108
109
110 Error(me; IPoint, CurveIndex: Integer)
111 ---Purpose: returns the distance between the MultiPoint of range
112 -- IPoint and the curve CurveIndex.
113
114 returns Real
115 is static;
116
117
118 MaxError3d(me)
119 ---Purpose: returns the maximum distance between the points
120 -- and the MultiCurve.
121
122 returns Real
123 is static;
124
125 MaxError2d(me)
126 ---Purpose: returns the maximum distance between the points
127 -- and the MultiCurve.
128
129 returns Real
130 is static;
131
132
133 FirstConstraint(me; TheConstraints: HArray1OfConstraintCouple;
134 FirstPoint: Integer)
135 ---Purpose:
136
137 returns Constraint from AppParCurves
138 is static;
139
140
141 LastConstraint(me; TheConstraints: HArray1OfConstraintCouple;
142 LastPoint: Integer)
143 ---Purpose:
144
145 returns Constraint from AppParCurves
146 is static;
147
148
149fields
150
151Done: Boolean;
152MyMultiLine : MultiLine;
153MyMultiCurve: MultiCurve from AppParCurves;
154Degre: Integer;
155myParameters: Vector;
156FVal: Real;
157ValGrad_F: Vector from math;
158MyF: Matrix from math;
159PTLX : Matrix from math;
160PTLY : Matrix from math;
161PTLZ : Matrix from math;
162A: Matrix from math;
163DA: Matrix from math;
164MyLeastSquare : Squares;
165Contraintes: Boolean;
166NbP: Integer;
167NbCu: Integer;
168Adeb: Integer;
169Afin: Integer;
170tabdim: HArray1OfInteger from TColStd;
171ERR3d: Real;
172ERR2d: Real;
173FirstP: Integer;
174LastP: Integer;
175myConstraints: HArray1OfConstraintCouple from AppParCurves;
176
177end Function;