LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zlarge ( integer  N,
complex*16, dimension( lda, * )  A,
integer  LDA,
integer, dimension( 4 )  ISEED,
complex*16, dimension( * )  WORK,
integer  INFO 
)

ZLARGE

Purpose:
 ZLARGE pre- and post-multiplies a complex general n by n matrix A
 with a random unitary matrix: A = U*D*U'.
Parameters
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in,out]A
          A is COMPLEX*16 array, dimension (LDA,N)
          On entry, the original n by n matrix A.
          On exit, A is overwritten by U*A*U' for some random
          unitary matrix U.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= N.
[in,out]ISEED
          ISEED is INTEGER array, dimension (4)
          On entry, the seed of the random number generator; the array
          elements must be between 0 and 4095, and ISEED(4) must be
          odd.
          On exit, the seed is updated.
[out]WORK
          WORK is COMPLEX*16 array, dimension (2*N)
[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.
Date
November 2011

Definition at line 89 of file zlarge.f.

89 *
90 * -- LAPACK auxiliary routine (version 3.4.0) --
91 * -- LAPACK is a software package provided by Univ. of Tennessee, --
92 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
93 * November 2011
94 *
95 * .. Scalar Arguments ..
96  INTEGER info, lda, n
97 * ..
98 * .. Array Arguments ..
99  INTEGER iseed( 4 )
100  COMPLEX*16 a( lda, * ), work( * )
101 * ..
102 *
103 * =====================================================================
104 *
105 * .. Parameters ..
106  COMPLEX*16 zero, one
107  parameter ( zero = ( 0.0d+0, 0.0d+0 ),
108  $ one = ( 1.0d+0, 0.0d+0 ) )
109 * ..
110 * .. Local Scalars ..
111  INTEGER i
112  DOUBLE PRECISION wn
113  COMPLEX*16 tau, wa, wb
114 * ..
115 * .. External Subroutines ..
116  EXTERNAL xerbla, zgemv, zgerc, zlarnv, zscal
117 * ..
118 * .. Intrinsic Functions ..
119  INTRINSIC abs, dble, max
120 * ..
121 * .. External Functions ..
122  DOUBLE PRECISION dznrm2
123  EXTERNAL dznrm2
124 * ..
125 * .. Executable Statements ..
126 *
127 * Test the input arguments
128 *
129  info = 0
130  IF( n.LT.0 ) THEN
131  info = -1
132  ELSE IF( lda.LT.max( 1, n ) ) THEN
133  info = -3
134  END IF
135  IF( info.LT.0 ) THEN
136  CALL xerbla( 'ZLARGE', -info )
137  RETURN
138  END IF
139 *
140 * pre- and post-multiply A by random unitary matrix
141 *
142  DO 10 i = n, 1, -1
143 *
144 * generate random reflection
145 *
146  CALL zlarnv( 3, iseed, n-i+1, work )
147  wn = dznrm2( n-i+1, work, 1 )
148  wa = ( wn / abs( work( 1 ) ) )*work( 1 )
149  IF( wn.EQ.zero ) THEN
150  tau = zero
151  ELSE
152  wb = work( 1 ) + wa
153  CALL zscal( n-i, one / wb, work( 2 ), 1 )
154  work( 1 ) = one
155  tau = dble( wb / wa )
156  END IF
157 *
158 * multiply A(i:n,1:n) by random reflection from the left
159 *
160  CALL zgemv( 'Conjugate transpose', n-i+1, n, one, a( i, 1 ),
161  $ lda, work, 1, zero, work( n+1 ), 1 )
162  CALL zgerc( n-i+1, n, -tau, work, 1, work( n+1 ), 1, a( i, 1 ),
163  $ lda )
164 *
165 * multiply A(1:n,i:n) by random reflection from the right
166 *
167  CALL zgemv( 'No transpose', n, n-i+1, one, a( 1, i ), lda,
168  $ work, 1, zero, work( n+1 ), 1 )
169  CALL zgerc( n, n-i+1, -tau, work( n+1 ), 1, work, 1, a( 1, i ),
170  $ lda )
171  10 CONTINUE
172  RETURN
173 *
174 * End of ZLARGE
175 *
subroutine zlarnv(IDIST, ISEED, N, X)
ZLARNV returns a vector of random numbers from a uniform or normal distribution.
Definition: zlarnv.f:101
subroutine zgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
ZGEMV
Definition: zgemv.f:160
subroutine zgerc(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)
ZGERC
Definition: zgerc.f:132
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
double precision function dznrm2(N, X, INCX)
DZNRM2
Definition: dznrm2.f:56
subroutine zscal(N, ZA, ZX, INCX)
ZSCAL
Definition: zscal.f:54

Here is the call graph for this function:

Here is the caller graph for this function: