3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SOPGTR + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/sopgtr.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/sopgtr.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sopgtr.f">
21 * SUBROUTINE SOPGTR( UPLO, N, AP, TAU, Q, LDQ, WORK, INFO )
23 * .. Scalar Arguments ..
25 * INTEGER INFO, LDQ, N
27 * .. Array Arguments ..
28 * REAL AP( * ), Q( LDQ, * ), TAU( * ), WORK( * )
37 *> SOPGTR generates a real orthogonal matrix Q which is defined as the
38 *> product of n-1 elementary reflectors H(i) of order n, as returned by
39 *> SSPTRD using packed storage:
41 *> if UPLO = 'U', Q = H(n-1) . . . H(2) H(1),
43 *> if UPLO = 'L', Q = H(1) H(2) . . . H(n-1).
51 *> UPLO is CHARACTER*1
52 *> = 'U': Upper triangular packed storage used in previous
54 *> = 'L': Lower triangular packed storage used in previous
61 *> The order of the matrix Q. N >= 0.
66 *> AP is REAL array, dimension (N*(N+1)/2)
67 *> The vectors which define the elementary reflectors, as
68 *> returned by SSPTRD.
73 *> TAU is REAL array, dimension (N-1)
74 *> TAU(i) must contain the scalar factor of the elementary
75 *> reflector H(i), as returned by SSPTRD.
80 *> Q is REAL array, dimension (LDQ,N)
81 *> The N-by-N orthogonal matrix Q.
87 *> The leading dimension of the array Q. LDQ >= max(1,N).
92 *> WORK is REAL array, dimension (N-1)
98 *> = 0: successful exit
99 *> < 0: if INFO = -i, the i-th argument had an illegal value
105 *> \author Univ. of Tennessee
106 *> \author Univ. of California Berkeley
107 *> \author Univ. of Colorado Denver
110 *> \date November 2011
112 *> \ingroup realOTHERcomputational
114 * =====================================================================
115 SUBROUTINE SOPGTR( UPLO, N, AP, TAU, Q, LDQ, WORK, INFO )
117 * -- LAPACK computational routine (version 3.4.0) --
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 ..
126 * .. Array Arguments ..
127 REAL AP( * ), Q( LDQ, * ), TAU( * ), WORK( * )
130 * =====================================================================
134 PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 )
136 * .. Local Scalars ..
138 INTEGER I, IINFO, IJ, J
140 * .. External Functions ..
144 * .. External Subroutines ..
145 EXTERNAL SORG2L, SORG2R, XERBLA
147 * .. Intrinsic Functions ..
150 * .. Executable Statements ..
152 * Test the input arguments
155 UPPER = LSAME( UPLO, 'U' )
156 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
158 ELSE IF( N.LT.0 ) THEN
160 ELSE IF( LDQ.LT.MAX( 1, N ) ) THEN
164 CALL XERBLA( 'SOPGTR', -INFO )
168 * Quick return if possible
175 * Q was determined by a call to SSPTRD with UPLO = 'U'
177 * Unpack the vectors which define the elementary reflectors and
178 * set the last row and column of Q equal to those of the unit
195 * Generate Q(1:n-1,1:n-1)
197 CALL SORG2L( N-1, N-1, N-1, Q, LDQ, TAU, WORK, IINFO )
201 * Q was determined by a call to SSPTRD with UPLO = 'L'.
203 * Unpack the vectors which define the elementary reflectors and
204 * set the first row and column of Q equal to those of the unit
222 * Generate Q(2:n,2:n)
224 CALL SORG2R( N-1, N-1, N-1, Q( 2, 2 ), LDQ, TAU, WORK,