0024162: Eliminate CLang compiler warning
[occt.git] / src / math / math_SVD.cdl
1 -- Created on: 1991-05-13
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 class SVD from math
24         ---Purpose: SVD implements the solution of a set of N linear equations
25         -- of M unknowns without condition on N or M. The Singular
26         -- Value Decomposition algorithm is used. For singular or
27         -- nearly singular matrices SVD is a better choice than Gauss
28         -- or GaussLeastSquare.
29
30 uses Matrix from math, 
31      Vector from math,
32      OStream from Standard
33
34 raises NotDone from StdFail,
35        DimensionError from Standard
36
37 is
38
39     Create(A: Matrix)
40         ---Purpose: 
41         -- Given as input an n X m matrix A with n < m, n = m or n > m 
42         -- this constructor performs the Singular Value Decomposition.
43
44     returns SVD;
45     
46     
47     IsDone(me)
48         ---Purpose: Returns true if the computations are successful, otherwise returns false.
49         ---C++: inline
50     returns Boolean
51     is static;
52     
53     
54     Solve(me; B: Vector; X: out Vector; Eps: Real = 1.0e-6)    
55         ---Purpose:
56         -- Given the input Vector B this routine solves the set of linear 
57         -- equations A . X = B. 
58         -- Exception NotDone is raised if the decomposition of A was not done
59         -- successfully.
60         -- Exception DimensionError is raised if the range of B is not 
61         -- equal to the rowrange of A.
62         -- Exception DimensionError is raised if the range of X is not 
63         -- equal to the colrange of A.
64     
65     raises NotDone,
66            DimensionError
67     is static;
68
69
70     PseudoInverse(me; Inv : out Matrix; Eps: Real= 1.0e-6)
71         ---Purpose: Computes the inverse Inv of matrix A such as A * Inverse = Identity.
72         -- Exceptions
73         -- StdFail_NotDone if the algorithm fails (and IsDone returns false).
74         -- Standard_DimensionError if the ranges of Inv are
75         -- compatible with the ranges of A.
76
77     raises NotDone
78     is static;
79     
80
81     Dump(me; o: in out OStream)
82         ---Purpose: Prints information on the current state of the object.
83         --          Is used to redefine the operator <<.
84
85     is static;
86
87
88 fields
89
90 Done:       Boolean;
91 U:          Matrix;
92 V:          Matrix;
93 Diag:       Vector;
94 RowA:       Integer;
95
96 end SVD;