1
*> \brief \b SGEQR2 computes the QR factorization of a general rectangular matrix using an unblocked algorithm.
3
* =========== DOCUMENTATION ===========
5
* Online html documentation available at
6
* http://www.netlib.org/lapack/explore-html/
9
*> Download SGEQR2 + dependencies
10
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/sgeqr2.f">
12
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/sgeqr2.f">
14
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgeqr2.f">
21
* SUBROUTINE SGEQR2( M, N, A, LDA, TAU, WORK, INFO )
23
* .. Scalar Arguments ..
24
* INTEGER INFO, LDA, M, N
26
* .. Array Arguments ..
27
* REAL A( LDA, * ), TAU( * ), WORK( * )
36
*> SGEQR2 computes a QR factorization of a real m by n matrix A:
46
*> The number of rows of the matrix A. M >= 0.
52
*> The number of columns of the matrix A. N >= 0.
57
*> A is REAL array, dimension (LDA,N)
58
*> On entry, the m by n matrix A.
59
*> On exit, the elements on and above the diagonal of the array
60
*> contain the min(m,n) by n upper trapezoidal matrix R (R is
61
*> upper triangular if m >= n); the elements below the diagonal,
62
*> with the array TAU, represent the orthogonal matrix Q as a
63
*> product of elementary reflectors (see Further Details).
69
*> The leading dimension of the array A. LDA >= max(1,M).
74
*> TAU is REAL array, dimension (min(M,N))
75
*> The scalar factors of the elementary reflectors (see Further
81
*> WORK is REAL array, dimension (N)
87
*> = 0: successful exit
88
*> < 0: if INFO = -i, the i-th argument had an illegal value
94
*> \author Univ. of Tennessee
95
*> \author Univ. of California Berkeley
96
*> \author Univ. of Colorado Denver
99
*> \date September 2012
101
*> \ingroup realGEcomputational
103
*> \par Further Details:
104
* =====================
108
*> The matrix Q is represented as a product of elementary reflectors
110
*> Q = H(1) H(2) . . . H(k), where k = min(m,n).
112
*> Each H(i) has the form
114
*> H(i) = I - tau * v * v**T
116
*> where tau is a real scalar, and v is a real vector with
117
*> v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
118
*> and tau in TAU(i).
121
* =====================================================================
1
122
SUBROUTINE SGEQR2( M, N, A, LDA, TAU, WORK, INFO )
3
* -- LAPACK routine (version 2.0) --
4
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5
* Courant Institute, Argonne National Lab, and Rice University
124
* -- LAPACK computational routine (version 3.4.2) --
125
* -- LAPACK is a software package provided by Univ. of Tennessee, --
126
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
8
129
* .. Scalar Arguments ..
9
130
INTEGER INFO, LDA, M, N
12
133
REAL A( LDA, * ), TAU( * ), WORK( * )
16
* $Id: sgeqr2.f 19697 2010-10-29 16:57:34Z d3y133 $
21
* SGEQR2 computes a QR factorization of a real m by n matrix A:
28
* The number of rows of the matrix A. M >= 0.
31
* The number of columns of the matrix A. N >= 0.
33
* A (input/output) REAL array, dimension (LDA,N)
34
* On entry, the m by n matrix A.
35
* On exit, the elements on and above the diagonal of the array
36
* contain the min(m,n) by n upper trapezoidal matrix R (R is
37
* upper triangular if m >= n); the elements below the diagonal,
38
* with the array TAU, represent the orthogonal matrix Q as a
39
* product of elementary reflectors (see Further Details).
42
* The leading dimension of the array A. LDA >= max(1,M).
44
* TAU (output) REAL array, dimension (min(M,N))
45
* The scalar factors of the elementary reflectors (see Further
48
* WORK (workspace) REAL array, dimension (N)
50
* INFO (output) INTEGER
51
* = 0: successful exit
52
* < 0: if INFO = -i, the i-th argument had an illegal value
57
* The matrix Q is represented as a product of elementary reflectors
59
* Q = H(1) H(2) . . . H(k), where k = min(m,n).
61
* Each H(i) has the form
63
* H(i) = I - tau * v * v'
65
* where tau is a real scalar, and v is a real vector with
66
* v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
69
136
* =====================================================================
71
138
* .. Parameters ..