1       LOGICAL FUNCTION CGENND (M, N, A, LDA)
 2       IMPLICIT NONE
 3 *
 4 *  -- LAPACK test routine (version 3.1) --
 5 *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
 6 *     February 2008
 7 *
 8 *     .. Scalar Arguments ..
 9       INTEGER M, N, LDA
10 *     ..
11 *     .. Array Arguments ..
12       COMPLEX A( LDA, * )
13 *     ..
14 *
15 *  Purpose
16 *  =======
17 *
18 *     CGENND tests that its argument has a real, non-negative diagonal.
19 *
20 *  Arguments
21 *  =========
22 *
23 *  M       (input) INTEGER
24 *          The number of rows in A.
25 *
26 *  N       (input) INTEGER
27 *          The number of columns in A.
28 *
29 *  A       (input) COMPLEX array, dimension (LDA, N)
30 *          The matrix.
31 *
32 *  LDA     (input) INTEGER
33 *          Leading dimension of A.
34 *
35 *  =====================================================================
36 *
37 *     .. Parameters ..
38       REAL               ZERO
39       PARAMETER          ( ZERO = 0.0E0 )
40 *     ..
41 *     .. Local Scalars ..
42       LOGICAL OUT
43       INTEGER I, K
44       COMPLEX AII
45 *     ..
46 *     .. Intrinsics ..
47       INTRINSIC MIN, REAL, AIMAG
48 *     ..
49 *     .. Executable Statements ..
50       K = MIN( M, N )
51       DO I = 1, K
52          AII = A( I, I )
53          IFREAL( AII ).LT.ZERO.OR.AIMAG( AII ).NE.ZERO ) THEN
54             CGENND = .FALSE.
55             RETURN
56          END IF
57       END DO
58       CGENND = .TRUE.
59       RETURN
60       END