157 SUBROUTINE claror( SIDE, INIT, M, N, A, LDA, ISEED, X, INFO )
165 INTEGER INFO, LDA, M, N
169 COMPLEX A( LDA, * ), X( * )
175 REAL ZERO, ONE, TOOSML
176 parameter( zero = 0.0e+0, one = 1.0e+0,
179 parameter( czero = ( 0.0e+0, 0.0e+0 ),
180 $ cone = ( 1.0e+0, 0.0e+0 ) )
183 INTEGER IROW, ITYPE, IXFRM, J, JCOL, KBEG, NXFRM
184 REAL FACTOR, XABS, XNORM
185 COMPLEX CSIGN, XNORMS
191 EXTERNAL lsame, scnrm2, clarnd
197 INTRINSIC abs, cmplx, conjg
202 IF( n.EQ.0 .OR. m.EQ.0 )
206 IF( lsame( side,
'L' ) )
THEN
208 ELSE IF( lsame( side,
'R' ) )
THEN
210 ELSE IF( lsame( side,
'C' ) )
THEN
212 ELSE IF( lsame( side,
'T' ) )
THEN
218 IF( itype.EQ.0 )
THEN
220 ELSE IF( m.LT.0 )
THEN
222 ELSE IF( n.LT.0 .OR. ( itype.EQ.3 .AND. n.NE.m ) )
THEN
224 ELSE IF( lda.LT.m )
THEN
228 CALL xerbla(
'CLAROR', -info )
232 IF( itype.EQ.1 )
THEN
240 IF( lsame( init,
'I' ) )
241 $
CALL claset(
'Full', m, n, czero, cone, a, lda )
254 DO 60 ixfrm = 2, nxfrm
255 kbeg = nxfrm - ixfrm + 1
259 DO 50 j = kbeg, nxfrm
260 x( j ) = clarnd( 3, iseed )
265 xnorm = scnrm2( ixfrm, x( kbeg ), 1 )
266 xabs = abs( x( kbeg ) )
267 IF( xabs.NE.czero )
THEN
268 csign = x( kbeg ) / xabs
273 x( nxfrm+kbeg ) = -csign
274 factor = xnorm*( xnorm+xabs )
275 IF( abs( factor ).LT.toosml )
THEN
277 CALL xerbla(
'CLAROR', -info )
280 factor = one / factor
282 x( kbeg ) = x( kbeg ) + xnorms
286 IF( itype.EQ.1 .OR. itype.EQ.3 .OR. itype.EQ.4 )
THEN
290 CALL cgemv(
'C', ixfrm, n, cone, a( kbeg, 1 ), lda,
291 $ x( kbeg ), 1, czero, x( 2*nxfrm+1 ), 1 )
292 CALL cgerc( ixfrm, n, -cmplx( factor ), x( kbeg ), 1,
293 $ x( 2*nxfrm+1 ), 1, a( kbeg, 1 ), lda )
297 IF( itype.GE.2 .AND. itype.LE.4 )
THEN
301 IF( itype.EQ.4 )
THEN
302 CALL clacgv( ixfrm, x( kbeg ), 1 )
305 CALL cgemv(
'N', m, ixfrm, cone, a( 1, kbeg ), lda,
306 $ x( kbeg ), 1, czero, x( 2*nxfrm+1 ), 1 )
307 CALL cgerc( m, ixfrm, -cmplx( factor ), x( 2*nxfrm+1 ), 1,
308 $ x( kbeg ), 1, a( 1, kbeg ), lda )
313 x( 1 ) = clarnd( 3, iseed )
315 IF( xabs.NE.zero )
THEN
316 csign = x( 1 ) / xabs
324 IF( itype.EQ.1 .OR. itype.EQ.3 .OR. itype.EQ.4 )
THEN
326 CALL cscal( n, conjg( x( nxfrm+irow ) ), a( irow, 1 ), lda )
330 IF( itype.EQ.2 .OR. itype.EQ.3 )
THEN
332 CALL cscal( m, x( nxfrm+jcol ), a( 1, jcol ), 1 )
336 IF( itype.EQ.4 )
THEN
338 CALL cscal( m, conjg( x( nxfrm+jcol ) ), a( 1, jcol ), 1 )
subroutine xerbla(srname, info)
subroutine claror(side, init, m, n, a, lda, iseed, x, info)
CLAROR
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine cgerc(m, n, alpha, x, incx, y, incy, a, lda)
CGERC
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine cscal(n, ca, cx, incx)
CSCAL