145 SUBROUTINE dlaror( SIDE, INIT, M, N, A, LDA, ISEED, X, INFO )
153 INTEGER INFO, LDA, M, N
157 DOUBLE PRECISION A( LDA, * ), X( * )
163 DOUBLE PRECISION ZERO, ONE, TOOSML
164 parameter( zero = 0.0d+0, one = 1.0d+0,
168 INTEGER IROW, ITYPE, IXFRM, J, JCOL, KBEG, NXFRM
169 DOUBLE PRECISION FACTOR, XNORM, XNORMS
173 DOUBLE PRECISION DLARND, DNRM2
174 EXTERNAL lsame, dlarnd, dnrm2
185 IF( n.EQ.0 .OR. m.EQ.0 )
189 IF( lsame( side,
'L' ) )
THEN
191 ELSE IF( lsame( side,
'R' ) )
THEN
193 ELSE IF( lsame( side,
'C' ) .OR. lsame( side,
'T' ) )
THEN
199 IF( itype.EQ.0 )
THEN
201 ELSE IF( m.LT.0 )
THEN
203 ELSE IF( n.LT.0 .OR. ( itype.EQ.3 .AND. n.NE.m ) )
THEN
205 ELSE IF( lda.LT.m )
THEN
209 CALL xerbla(
'DLAROR', -info )
213 IF( itype.EQ.1 )
THEN
221 IF( lsame( init,
'I' ) )
222 $
CALL dlaset(
'Full', m, n, zero, one, a, lda )
233 DO 30 ixfrm = 2, nxfrm
234 kbeg = nxfrm - ixfrm + 1
238 DO 20 j = kbeg, nxfrm
239 x( j ) = dlarnd( 3, iseed )
244 xnorm = dnrm2( ixfrm, x( kbeg ), 1 )
245 xnorms = sign( xnorm, x( kbeg ) )
246 x( kbeg+nxfrm ) = sign( one, -x( kbeg ) )
247 factor = xnorms*( xnorms+x( kbeg ) )
248 IF( abs( factor ).LT.toosml )
THEN
250 CALL xerbla(
'DLAROR', info )
253 factor = one / factor
255 x( kbeg ) = x( kbeg ) + xnorms
259 IF( itype.EQ.1 .OR. itype.EQ.3 )
THEN
263 CALL dgemv(
'T', ixfrm, n, one, a( kbeg, 1 ), lda,
264 $ x( kbeg ), 1, zero, x( 2*nxfrm+1 ), 1 )
265 CALL dger( ixfrm, n, -factor, x( kbeg ), 1, x( 2*nxfrm+1 ),
266 $ 1, a( kbeg, 1 ), lda )
270 IF( itype.EQ.2 .OR. itype.EQ.3 )
THEN
274 CALL dgemv(
'N', m, ixfrm, one, a( 1, kbeg ), lda,
275 $ x( kbeg ), 1, zero, x( 2*nxfrm+1 ), 1 )
276 CALL dger( m, ixfrm, -factor, x( 2*nxfrm+1 ), 1, x( kbeg ),
277 $ 1, a( 1, kbeg ), lda )
282 x( 2*nxfrm ) = sign( one, dlarnd( 3, iseed ) )
286 IF( itype.EQ.1 .OR. itype.EQ.3 )
THEN
288 CALL dscal( n, x( nxfrm+irow ), a( irow, 1 ), lda )
292 IF( itype.EQ.2 .OR. itype.EQ.3 )
THEN
294 CALL dscal( m, x( nxfrm+jcol ), a( 1, jcol ), 1 )
subroutine xerbla(srname, info)
subroutine dlaror(side, init, m, n, a, lda, iseed, x, info)
DLAROR
subroutine dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
DGEMV
subroutine dger(m, n, alpha, x, incx, y, incy, a, lda)
DGER
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine dscal(n, da, dx, incx)
DSCAL