Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Matrices/standard_floating_qr_decomposition.ads, Revision 1.1.1.1
1.1 maekawa 1: with Standard_Natural_Vectors;
2: with Standard_Floating_Vectors;
3: with Standard_Floating_Matrices;
4:
5: package Standard_Floating_QR_Decomposition is
6:
7: -- DESCRIPTION :
8: -- This package provides an implementation of QR-decomposition for
9: -- matrices of standard floating numbers.
10:
11: procedure QRD ( x : in out Standard_Floating_Matrices.Matrix;
12: qraux : in out Standard_Floating_Vectors.Vector;
13: jpvt : in out Standard_Natural_Vectors.Vector;
14: piv : in boolean );
15:
16: -- DESCRIPTION :
17: -- Uses Householder transformations to compute the QR decomposition of x.
18: -- Column pivoting based on 2-norms of reduced columns is optional.
19:
20: -- REQUIRED : jpvt'range = x'range(2) = qraux'range,
21: -- x'length(1) >= x'length(2)
22:
23: -- ON ENTRY :
24: -- x matrix whose decomposition is to be computed;
25: -- jpvt controls the selection of the pivot columns.
26: -- The k-th column x(k) of x is placed in one of three classes
27: -- according to the value of jpvt(k):
28: -- if jpvt(k) > 0, then x(k) is an initial column.
29: -- if jpvt(k) = 0, then x(k) is a free column.
30: -- if jpvt(k) < 0, then x(k) is a final column.
31: -- before the decomposition is computed, initial columns are
32: -- moved to the beginning of the array x and final columns to
33: -- the end. Both initial and final columns are frozen in place
34: -- during the computation and only free columns are moved.
35: -- At the k-th stage of the reduction, if x(k) is occupied by a
36: -- free column it is interchanged with the free column of
37: -- largest reduced norm. jpvt is not referenced if not piv.
38: -- piv column pivoting is performed if and only if piv is true.
39:
40: -- ON RETURN :
41: -- x x contains in its upper triangle the upper triangular matrix
42: -- R of the QR factorization. Below its diagonal x contains
43: -- information from which the orthogonal part of the
44: -- decomposition can be recovered. Note that if pivoting has
45: -- been requested, the decomposition is not that of the original
46: -- matrix x but that of x with its columns permuted as described
47: -- by jpvt.
48: -- qraux qraux contains further information required to recover
49: -- the orthogonal part of the decomposition.
50: -- jpvt jpvt(k) contains the index of the column of the original
51: -- matrix that has been interchanged into the k-th column,
52: -- if pivoting was requested.
53:
54: -- ACKNOWLEDGMENT :
55: -- This Ada Version is a translation of the LINPACK version, dated 08/14/78,
56: -- written by G.W. Stewart, University of Maryland, Argonne National Lab.
57:
58: procedure Permute_Columns ( x : in out Standard_Floating_Matrices.Matrix;
59: jpvt : in Standard_Natural_Vectors.Vector );
60:
61: -- DESCRIPTION :
62: -- Permutes the columns of the matrix x according to jpvt:
63: -- x := (x(jpvt(1)),x(jpvt(2)), ... ,x(jpvt(k))), k = jpvt'last.
64: -- This routine is useful to the Least Squares computation.
65:
66: procedure Permute ( x : in out Standard_Floating_Vectors.Vector;
67: jpvt : in Standard_Natural_Vectors.Vector );
68:
69: -- DESCRIPTION :
70: -- Permutes the columns of the vector x according to jpvt:
71: -- x := (x(jpvt(1)),x(jpvt(2)), ... ,x(jpvt(k))), k = jpvt'last.
72: -- This routine is useful to the Least Squares computation.
73:
74: procedure Basis ( qr : in out Standard_Floating_Matrices.Matrix;
75: x : in Standard_Floating_Matrices.Matrix );
76:
77: -- DESCRIPTION :
78: -- Retrieves the orthogonal part of the decomposition.
79: -- The columns of qr on output correspond to the column span of x.
80:
81: -- IMPORTANT :
82: -- Note that this does not work when pivoting was requested.
83:
84: -- REQUIRED : qr'range(1) = qr'range(2) = x'range(1).
85:
86: -- ON ENTRY :
87: -- qr contains output of the routine qrd;
88: -- x original matrix as part of the input of qrd.
89:
90: -- ON RETURN :
91: -- qr orthogonal part of the QR-decomposition.
92:
93: end Standard_Floating_QR_Decomposition;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>