0024624: Lost word in license statement in source files
[occt.git] / src / AppCont / AppCont_LeastSquare.cdl
CommitLineData
b311480e 1-- Created on: 1993-04-22
2-- Created by: Laurent PAINNOT
3-- Copyright (c) 1993-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--
d5f74e42 8-- This library is free software; you can redistribute it and/or modify it under
9-- the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 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 LeastSquare from AppCont(MultiLine as any;
18 LineTool as any)
19 ---as TheToolLine(MultiLine)
20
21 ---Purpose:
22
23
24uses Matrix from math,
25 Vector from math,
26 Constraint from AppParCurves,
27 MultiCurve from AppParCurves
28
29
30raises NotDone from StdFail,
31 OutOfRange from Standard,
32 DimensionError from Standard
33
34
35
36is
37
38 Create(SSP: MultiLine; U0, U1: Real; FirstCons, LastCons: Constraint;
39 Deg: Integer; NbPoints: Integer = 24)
40 ---Purpose: given a continous MultiLine, this algorithm computes
41 -- the approximation into Bezier curves.
42 -- NbPoints points are taken on the initial MultiLine for
43 -- minimizing the surface between the MultiLine and the
44 -- Bezier curves doing the approximation.
45 -- The first point will be the point of parameter U0 with
46 -- a constraint FirstCons.
47 -- The last point will be the point of parameter U1 with
48 -- a constraint LastCons.
49
50 returns LeastSquare from AppCont
51 raises DimensionError from Standard;
52
53
54
55 IsDone(me)
56 ---Purpose: returns True if all has been correctly done.
57
58 returns Boolean
59 is static;
60
61
62 Value(me: in out)
63 ---Purpose: returns the result of the approximation, i.e. a
64 -- MultiCurve.
65 -- An exception is raised if NotDone.
66 ---C++: return const &
67
68 returns MultiCurve from AppParCurves
69 raises NotDone from StdFail
70 is static;
71
72
73 NbBColumns(me; SSP: MultiLine)
74 ---Purpose: is internally used by the constuctor.
75
76 returns Integer
77 is static protected;
78
79
80 Error(me; F: in out Real; MaxE3d, MaxE2d: in out Real)
81 ---Purpose: F is the sum of the square errors at each of the
82 -- NbPoints of the MultiLine.
83 -- MaxE3d is the maximum 3d value of these errors.
84 -- MaxE2d is the maximum 2d value of these errors.
85 -- An exception is raised if NotDone.
86
87 raises NotDone from StdFail
88 is static;
89
90
91
92fields
93
94Done: Boolean;
95SCU: MultiCurve from AppParCurves;
96Degre: Integer;
97Nbdiscret: Integer;
98nbP: Integer;
99nbP2d: Integer;
100Points: Matrix;
101Poles: Matrix;
102myParam: Vector;
103VB: Matrix;
104
105end LeastSquare from AppCont;
106