LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

◆ dorghr()

subroutine dorghr ( integer n,
integer ilo,
integer ihi,
double precision, dimension( lda, * ) a,
integer lda,
double precision, dimension( * ) tau,
double precision, dimension( * ) work,
integer lwork,
integer info )

DORGHR

Download DORGHR + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!> !> DORGHR generates a real orthogonal matrix Q which is defined as the !> product of IHI-ILO elementary reflectors of order N, as returned by !> DGEHRD: !> !> Q = H(ilo) H(ilo+1) . . . H(ihi-1). !>
Parameters
[in]N
!> N is INTEGER !> The order of the matrix Q. N >= 0. !>
[in]ILO
!> ILO is INTEGER !>
[in]IHI
!> IHI is INTEGER !> !> ILO and IHI must have the same values as in the previous call !> of DGEHRD. Q is equal to the unit matrix except in the !> submatrix Q(ilo+1:ihi,ilo+1:ihi). !> 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. !>
[in,out]A
!> A is DOUBLE PRECISION array, dimension (LDA,N) !> On entry, the vectors which define the elementary reflectors, !> as returned by DGEHRD. !> On exit, the N-by-N orthogonal matrix Q. !>
[in]LDA
!> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,N). !>
[in]TAU
!> TAU is DOUBLE PRECISION array, dimension (N-1) !> TAU(i) must contain the scalar factor of the elementary !> reflector H(i), as returned by DGEHRD. !>
[out]WORK
!> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)) !> On exit, if INFO = 0, WORK(1) returns the optimal LWORK. !>
[in]LWORK
!> LWORK is INTEGER !> The dimension of the array WORK. LWORK >= IHI-ILO. !> For optimum performance LWORK >= (IHI-ILO)*NB, where NB is !> the optimal blocksize. !> !> If LWORK = -1, then a workspace query is assumed; the routine !> only calculates the optimal size of the WORK array, returns !> this value as the first entry of the WORK array, and no error !> message related to LWORK is issued by XERBLA. !>
[out]INFO
!> INFO is INTEGER !> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value !>
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 123 of file dorghr.f.

125*
126* -- LAPACK computational routine --
127* -- LAPACK is a software package provided by Univ. of Tennessee, --
128* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
129*
130* .. Scalar Arguments ..
131 INTEGER IHI, ILO, INFO, LDA, LWORK, N
132* ..
133* .. Array Arguments ..
134 DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
135* ..
136*
137* =====================================================================
138*
139* .. Parameters ..
140 DOUBLE PRECISION ZERO, ONE
141 parameter( zero = 0.0d+0, one = 1.0d+0 )
142* ..
143* .. Local Scalars ..
144 LOGICAL LQUERY
145 INTEGER I, IINFO, J, LWKOPT, NB, NH
146* ..
147* .. External Subroutines ..
148 EXTERNAL dorgqr, xerbla
149* ..
150* .. External Functions ..
151 INTEGER ILAENV
152 EXTERNAL ilaenv
153* ..
154* .. Intrinsic Functions ..
155 INTRINSIC max, min
156* ..
157* .. Executable Statements ..
158*
159* Test the input arguments
160*
161 info = 0
162 nh = ihi - ilo
163 lquery = ( lwork.EQ.-1 )
164 IF( n.LT.0 ) THEN
165 info = -1
166 ELSE IF( ilo.LT.1 .OR. ilo.GT.max( 1, n ) ) THEN
167 info = -2
168 ELSE IF( ihi.LT.min( ilo, n ) .OR. ihi.GT.n ) THEN
169 info = -3
170 ELSE IF( lda.LT.max( 1, n ) ) THEN
171 info = -5
172 ELSE IF( lwork.LT.max( 1, nh ) .AND. .NOT.lquery ) THEN
173 info = -8
174 END IF
175*
176 IF( info.EQ.0 ) THEN
177 nb = ilaenv( 1, 'DORGQR', ' ', nh, nh, nh, -1 )
178 lwkopt = max( 1, nh )*nb
179 work( 1 ) = lwkopt
180 END IF
181*
182 IF( info.NE.0 ) THEN
183 CALL xerbla( 'DORGHR', -info )
184 RETURN
185 ELSE IF( lquery ) THEN
186 RETURN
187 END IF
188*
189* Quick return if possible
190*
191 IF( n.EQ.0 ) THEN
192 work( 1 ) = 1
193 RETURN
194 END IF
195*
196* Shift the vectors which define the elementary reflectors one
197* column to the right, and set the first ilo and the last n-ihi
198* rows and columns to those of the unit matrix
199*
200 DO 40 j = ihi, ilo + 1, -1
201 DO 10 i = 1, j - 1
202 a( i, j ) = zero
203 10 CONTINUE
204 DO 20 i = j + 1, ihi
205 a( i, j ) = a( i, j-1 )
206 20 CONTINUE
207 DO 30 i = ihi + 1, n
208 a( i, j ) = zero
209 30 CONTINUE
210 40 CONTINUE
211 DO 60 j = 1, ilo
212 DO 50 i = 1, n
213 a( i, j ) = zero
214 50 CONTINUE
215 a( j, j ) = one
216 60 CONTINUE
217 DO 80 j = ihi + 1, n
218 DO 70 i = 1, n
219 a( i, j ) = zero
220 70 CONTINUE
221 a( j, j ) = one
222 80 CONTINUE
223*
224 IF( nh.GT.0 ) THEN
225*
226* Generate Q(ilo+1:ihi,ilo+1:ihi)
227*
228 CALL dorgqr( nh, nh, nh, a( ilo+1, ilo+1 ), lda, tau( ilo ),
229 $ work, lwork, iinfo )
230 END IF
231 work( 1 ) = lwkopt
232 RETURN
233*
234* End of DORGHR
235*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
integer function ilaenv(ispec, name, opts, n1, n2, n3, n4)
ILAENV
Definition ilaenv.f:160
subroutine dorgqr(m, n, k, a, lda, tau, work, lwork, info)
DORGQR
Definition dorgqr.f:126
Here is the call graph for this function:
Here is the caller graph for this function: