1 *> \brief \b DORG2L generates all or part of the orthogonal matrix Q from a QL factorization determined by sgeqlf (unblocked algorithm).
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DORG2L + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dorg2l.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dorg2l.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dorg2l.f">
21 * SUBROUTINE DORG2L( M, N, K, A, LDA, TAU, WORK, INFO )
23 * .. Scalar Arguments ..
24 * INTEGER INFO, K, LDA, M, N
26 * .. Array Arguments ..
27 * DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
36 *> DORG2L generates an m by n real matrix Q with orthonormal columns,
37 *> which is defined as the last n columns of a product of k elementary
38 *> reflectors of order m
40 *> Q = H(k) . . . H(2) H(1)
42 *> as returned by DGEQLF.
51 *> The number of rows of the matrix Q. M >= 0.
57 *> The number of columns of the matrix Q. M >= N >= 0.
63 *> The number of elementary reflectors whose product defines the
64 *> matrix Q. N >= K >= 0.
69 *> A is DOUBLE PRECISION array, dimension (LDA,N)
70 *> On entry, the (n-k+i)-th column must contain the vector which
71 *> defines the elementary reflector H(i), for i = 1,2,...,k, as
72 *> returned by DGEQLF in the last k columns of its array
74 *> On exit, the m by n matrix Q.
80 *> The first dimension of the array A. LDA >= max(1,M).
85 *> TAU is DOUBLE PRECISION array, dimension (K)
86 *> TAU(i) must contain the scalar factor of the elementary
87 *> reflector H(i), as returned by DGEQLF.
92 *> WORK is DOUBLE PRECISION array, dimension (N)
98 *> = 0: successful exit
99 *> < 0: if INFO = -i, the i-th argument has an illegal value
105 *> \author Univ. of Tennessee
106 *> \author Univ. of California Berkeley
107 *> \author Univ. of Colorado Denver
110 *> \date September 2012
112 *> \ingroup doubleOTHERcomputational
114 * =====================================================================
115 SUBROUTINE DORG2L( M, N, K, A, LDA, TAU, WORK, INFO )
117 * -- LAPACK computational routine (version 3.4.2) --
118 * -- LAPACK is a software package provided by Univ. of Tennessee, --
119 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
122 * .. Scalar Arguments ..
123 INTEGER INFO, K, LDA, M, N
125 * .. Array Arguments ..
126 DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
129 * =====================================================================
132 DOUBLE PRECISION ONE, ZERO
133 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
135 * .. Local Scalars ..
138 * .. External Subroutines ..
139 EXTERNAL DLARF, DSCAL, XERBLA
141 * .. Intrinsic Functions ..
144 * .. Executable Statements ..
146 * Test the input arguments
151 ELSE IF( N.LT.0 .OR. N.GT.M ) THEN
153 ELSE IF( K.LT.0 .OR. K.GT.N ) THEN
155 ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
159 CALL XERBLA( 'DORG2L', -INFO )
163 * Quick return if possible
168 * Initialise columns 1:n-k to columns of the unit matrix
180 * Apply H(i) to A(1:m-k+i,1:n-k+i) from the left
182 A( M-N+II, II ) = ONE
183 CALL DLARF( 'Left', M-N+II, II-1, A( 1, II ), 1, TAU( I ), A,
185 CALL DSCAL( M-N+II-1, -TAU( I ), A( 1, II ), 1 )
186 A( M-N+II, II ) = ONE - TAU( I )
188 * Set A(m-k+i+1:m,n-k+i) to zero
190 DO 30 L = M - N + II + 1, M