LAPACK  3.9.1
LAPACK: Linear Algebra PACKage

◆ cget22()

subroutine cget22 ( character  TRANSA,
character  TRANSE,
character  TRANSW,
integer  N,
complex, dimension( lda, * )  A,
integer  LDA,
complex, dimension( lde, * )  E,
integer  LDE,
complex, dimension( * )  W,
complex, dimension( * )  WORK,
real, dimension( * )  RWORK,
real, dimension( 2 )  RESULT 
)

CGET22

Purpose:
 CGET22 does an eigenvector check.

 The basic test is:

    RESULT(1) = | A E  -  E W | / ( |A| |E| ulp )

 using the 1-norm.  It also tests the normalization of E:

    RESULT(2) = max | m-norm(E(j)) - 1 | / ( n ulp )
                 j

 where E(j) is the j-th eigenvector, and m-norm is the max-norm of a
 vector.  The max-norm of a complex n-vector x in this case is the
 maximum of |re(x(i)| + |im(x(i)| over i = 1, ..., n.
Parameters
[in]TRANSA
          TRANSA is CHARACTER*1
          Specifies whether or not A is transposed.
          = 'N':  No transpose
          = 'T':  Transpose
          = 'C':  Conjugate transpose
[in]TRANSE
          TRANSE is CHARACTER*1
          Specifies whether or not E is transposed.
          = 'N':  No transpose, eigenvectors are in columns of E
          = 'T':  Transpose, eigenvectors are in rows of E
          = 'C':  Conjugate transpose, eigenvectors are in rows of E
[in]TRANSW
          TRANSW is CHARACTER*1
          Specifies whether or not W is transposed.
          = 'N':  No transpose
          = 'T':  Transpose, same as TRANSW = 'N'
          = 'C':  Conjugate transpose, use -WI(j) instead of WI(j)
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]A
          A is COMPLEX array, dimension (LDA,N)
          The matrix whose eigenvectors are in E.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[in]E
          E is COMPLEX array, dimension (LDE,N)
          The matrix of eigenvectors. If TRANSE = 'N', the eigenvectors
          are stored in the columns of E, if TRANSE = 'T' or 'C', the
          eigenvectors are stored in the rows of E.
[in]LDE
          LDE is INTEGER
          The leading dimension of the array E.  LDE >= max(1,N).
[in]W
          W is COMPLEX array, dimension (N)
          The eigenvalues of A.
[out]WORK
          WORK is COMPLEX array, dimension (N*N)
[out]RWORK
          RWORK is REAL array, dimension (N)
[out]RESULT
          RESULT is REAL array, dimension (2)
          RESULT(1) = | A E  -  E W | / ( |A| |E| ulp )
          RESULT(2) = max | m-norm(E(j)) - 1 | / ( n ulp )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 141 of file cget22.f.

143 *
144 * -- LAPACK test routine --
145 * -- LAPACK is a software package provided by Univ. of Tennessee, --
146 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
147 *
148 * .. Scalar Arguments ..
149  CHARACTER TRANSA, TRANSE, TRANSW
150  INTEGER LDA, LDE, N
151 * ..
152 * .. Array Arguments ..
153  REAL RESULT( 2 ), RWORK( * )
154  COMPLEX A( LDA, * ), E( LDE, * ), W( * ), WORK( * )
155 * ..
156 *
157 * =====================================================================
158 *
159 * .. Parameters ..
160  REAL ZERO, ONE
161  parameter( zero = 0.0e+0, one = 1.0e+0 )
162  COMPLEX CZERO, CONE
163  parameter( czero = ( 0.0e+0, 0.0e+0 ),
164  $ cone = ( 1.0e+0, 0.0e+0 ) )
165 * ..
166 * .. Local Scalars ..
167  CHARACTER NORMA, NORME
168  INTEGER ITRNSE, ITRNSW, J, JCOL, JOFF, JROW, JVEC
169  REAL ANORM, ENORM, ENRMAX, ENRMIN, ERRNRM, TEMP1,
170  $ ULP, UNFL
171  COMPLEX WTEMP
172 * ..
173 * .. External Functions ..
174  LOGICAL LSAME
175  REAL CLANGE, SLAMCH
176  EXTERNAL lsame, clange, slamch
177 * ..
178 * .. External Subroutines ..
179  EXTERNAL cgemm, claset
180 * ..
181 * .. Intrinsic Functions ..
182  INTRINSIC abs, aimag, conjg, max, min, real
183 * ..
184 * .. Executable Statements ..
185 *
186 * Initialize RESULT (in case N=0)
187 *
188  result( 1 ) = zero
189  result( 2 ) = zero
190  IF( n.LE.0 )
191  $ RETURN
192 *
193  unfl = slamch( 'Safe minimum' )
194  ulp = slamch( 'Precision' )
195 *
196  itrnse = 0
197  itrnsw = 0
198  norma = 'O'
199  norme = 'O'
200 *
201  IF( lsame( transa, 'T' ) .OR. lsame( transa, 'C' ) ) THEN
202  norma = 'I'
203  END IF
204 *
205  IF( lsame( transe, 'T' ) ) THEN
206  itrnse = 1
207  norme = 'I'
208  ELSE IF( lsame( transe, 'C' ) ) THEN
209  itrnse = 2
210  norme = 'I'
211  END IF
212 *
213  IF( lsame( transw, 'C' ) ) THEN
214  itrnsw = 1
215  END IF
216 *
217 * Normalization of E:
218 *
219  enrmin = one / ulp
220  enrmax = zero
221  IF( itrnse.EQ.0 ) THEN
222  DO 20 jvec = 1, n
223  temp1 = zero
224  DO 10 j = 1, n
225  temp1 = max( temp1, abs( real( e( j, jvec ) ) )+
226  $ abs( aimag( e( j, jvec ) ) ) )
227  10 CONTINUE
228  enrmin = min( enrmin, temp1 )
229  enrmax = max( enrmax, temp1 )
230  20 CONTINUE
231  ELSE
232  DO 30 jvec = 1, n
233  rwork( jvec ) = zero
234  30 CONTINUE
235 *
236  DO 50 j = 1, n
237  DO 40 jvec = 1, n
238  rwork( jvec ) = max( rwork( jvec ),
239  $ abs( real( e( jvec, j ) ) )+
240  $ abs( aimag( e( jvec, j ) ) ) )
241  40 CONTINUE
242  50 CONTINUE
243 *
244  DO 60 jvec = 1, n
245  enrmin = min( enrmin, rwork( jvec ) )
246  enrmax = max( enrmax, rwork( jvec ) )
247  60 CONTINUE
248  END IF
249 *
250 * Norm of A:
251 *
252  anorm = max( clange( norma, n, n, a, lda, rwork ), unfl )
253 *
254 * Norm of E:
255 *
256  enorm = max( clange( norme, n, n, e, lde, rwork ), ulp )
257 *
258 * Norm of error:
259 *
260 * Error = AE - EW
261 *
262  CALL claset( 'Full', n, n, czero, czero, work, n )
263 *
264  joff = 0
265  DO 100 jcol = 1, n
266  IF( itrnsw.EQ.0 ) THEN
267  wtemp = w( jcol )
268  ELSE
269  wtemp = conjg( w( jcol ) )
270  END IF
271 *
272  IF( itrnse.EQ.0 ) THEN
273  DO 70 jrow = 1, n
274  work( joff+jrow ) = e( jrow, jcol )*wtemp
275  70 CONTINUE
276  ELSE IF( itrnse.EQ.1 ) THEN
277  DO 80 jrow = 1, n
278  work( joff+jrow ) = e( jcol, jrow )*wtemp
279  80 CONTINUE
280  ELSE
281  DO 90 jrow = 1, n
282  work( joff+jrow ) = conjg( e( jcol, jrow ) )*wtemp
283  90 CONTINUE
284  END IF
285  joff = joff + n
286  100 CONTINUE
287 *
288  CALL cgemm( transa, transe, n, n, n, cone, a, lda, e, lde, -cone,
289  $ work, n )
290 *
291  errnrm = clange( 'One', n, n, work, n, rwork ) / enorm
292 *
293 * Compute RESULT(1) (avoiding under/overflow)
294 *
295  IF( anorm.GT.errnrm ) THEN
296  result( 1 ) = ( errnrm / anorm ) / ulp
297  ELSE
298  IF( anorm.LT.one ) THEN
299  result( 1 ) = ( min( errnrm, anorm ) / anorm ) / ulp
300  ELSE
301  result( 1 ) = min( errnrm / anorm, one ) / ulp
302  END IF
303  END IF
304 *
305 * Compute RESULT(2) : the normalization error in E.
306 *
307  result( 2 ) = max( abs( enrmax-one ), abs( enrmin-one ) ) /
308  $ ( real( n )*ulp )
309 *
310  RETURN
311 *
312 * End of CGET22
313 *
logical function lde(RI, RJ, LR)
Definition: dblat2.f:2942
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine cgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CGEMM
Definition: cgemm.f:187
real function clange(NORM, M, N, A, LDA, WORK)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: clange.f:115
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.
Definition: claset.f:106
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:68
Here is the call graph for this function:
Here is the caller graph for this function: