1 SUBROUTINE DOPGTR
( UPLO
, N
, AP
, TAU
, Q
, LDQ
, WORK
, INFO
)
3 * -- LAPACK routine
(version
3.1) --
4 * Univ
. of Tennessee
, Univ
. of California Berkeley and NAG Ltd
..
7 * .. Scalar Arguments
..
11 * .. Array Arguments
..
12 DOUBLE PRECISION AP
( * ), Q
( LDQ
, * ), TAU
( * ), WORK
( * )
18 * DOPGTR generates a
real orthogonal matrix Q which is defined as the
19 * product of n
-1 elementary reflectors H
(i
) of order n
, as returned by
20 * DSPTRD using packed storage
:
22 * if UPLO
= 'U', Q
= H
(n
-1) . . . H
(2) H
(1),
24 * if UPLO
= 'L', Q
= H
(1) H
(2) . . . H
(n
-1).
29 * UPLO
(input
) CHARACTER*1
30 * = 'U': Upper triangular packed storage used in previous
32 * = 'L': Lower triangular packed storage used in previous
36 * The order of the matrix Q
. N
>= 0.
38 * AP
(input
) DOUBLE PRECISION array
, dimension (N*
(N
+1)/2)
39 * The vectors which define the elementary reflectors
, as
42 * TAU
(input
) DOUBLE PRECISION array
, dimension (N
-1)
43 * TAU
(i
) must contain the scalar factor of the elementary
44 * reflector H
(i
), as returned by DSPTRD
.
46 * Q
(output
) DOUBLE PRECISION array
, dimension (LDQ
,N
)
47 * The N
-by
-N orthogonal matrix Q
.
50 * The leading
dimension of the array Q
. LDQ
>= max
(1,N
).
52 * WORK
(workspace
) DOUBLE PRECISION array
, dimension (N
-1)
54 * INFO
(output
) INTEGER
55 * = 0: successful exit
56 * < 0: if INFO
= -i
, the i
-th argument had an illegal value
58 * =====================================================================
61 DOUBLE PRECISION ZERO
, ONE
62 PARAMETER ( ZERO
= 0.0D
+0, ONE
= 1.0D
+0 )
66 INTEGER I
, IINFO
, IJ
, J
68 * .. External Functions
..
72 * .. External Subroutines
..
73 EXTERNAL DORG2L
, DORG2R
, XERBLA
75 * .. Intrinsic Functions
..
78 * .. Executable Statements
..
80 * Test the input arguments
83 UPPER
= LSAME
( UPLO
, 'U' )
84 IF( .NOT
.UPPER
.AND
. .NOT
.LSAME
( UPLO
, 'L' ) ) THEN
86 ELSE IF( N
.LT
.0 ) THEN
88 ELSE IF( LDQ
.LT
.MAX
( 1, N
) ) THEN
92 CALL XERBLA
( 'DOPGTR', -INFO
)
96 * Quick
return if possible
103 * Q was determined by a
call to DSPTRD with UPLO
= 'U'
105 * Unpack the vectors which define the elementary reflectors and
106 * set the last row and column of Q equal
to those of the unit
123 * Generate Q
(1:n
-1,1:n
-1)
125 CALL DORG2L
( N
-1, N
-1, N
-1, Q
, LDQ
, TAU
, WORK
, IINFO
)
129 * Q was determined by a
call to DSPTRD with UPLO
= 'L'.
131 * Unpack the vectors which define the elementary reflectors and
132 * set the first row and column of Q equal
to those of the unit
150 * Generate Q
(2:n
,2:n
)
152 CALL DORG2R
( N
-1, N
-1, N
-1, Q
( 2, 2 ), LDQ
, TAU
, WORK
,