2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947 COMPLEX*16 ZERO, ONE
2948 parameter( zero = ( 0.0d0, 0.0d0 ),
2949 $ one = ( 1.0d0, 0.0d0 ) )
2950 COMPLEX*16 ROGUE
2951 parameter( rogue = ( -1.0d10, 1.0d10 ) )
2952 DOUBLE PRECISION RZERO
2953 parameter( rzero = 0.0d0 )
2954 DOUBLE PRECISION RROGUE
2955 parameter( rrogue = -1.0d10 )
2956
2957 COMPLEX*16 TRANSL
2958 INTEGER LDA, M, N, NMAX
2959 LOGICAL RESET
2960 CHARACTER*1 DIAG, UPLO
2961 CHARACTER*2 TYPE
2962
2963 COMPLEX*16 A( NMAX, * ), AA( * )
2964
2965 INTEGER I, IBEG, IEND, J, JJ
2966 LOGICAL GEN, HER, LOWER, SYM, TRI, UNIT, UPPER
2967
2968 COMPLEX*16 ZBEG
2970
2971 INTRINSIC dcmplx, dconjg, dble
2972
2973 gen = type.EQ.'GE'
2974 her = type.EQ.'HE'
2975 sym = type.EQ.'SY'
2976 tri = type.EQ.'TR'
2977 upper = ( her.OR.sym.OR.tri ).AND.uplo.EQ.'U'
2978 lower = ( her.OR.sym.OR.tri ).AND.uplo.EQ.'L'
2979 unit = tri.AND.diag.EQ.'U'
2980
2981
2982
2983 DO 20 j = 1, n
2984 DO 10 i = 1, m
2985 IF( gen.OR.( upper.AND.i.LE.j ).OR.( lower.AND.i.GE.j ) )
2986 $ THEN
2987 a( i, j ) =
zbeg( reset ) + transl
2988 IF( i.NE.j )THEN
2989
2990 IF( n.GT.3.AND.j.EQ.n/2 )
2991 $ a( i, j ) = zero
2992 IF( her )THEN
2993 a( j, i ) = dconjg( a( i, j ) )
2994 ELSE IF( sym )THEN
2995 a( j, i ) = a( i, j )
2996 ELSE IF( tri )THEN
2997 a( j, i ) = zero
2998 END IF
2999 END IF
3000 END IF
3001 10 CONTINUE
3002 IF( her )
3003 $ a( j, j ) = dcmplx( dble( a( j, j ) ), rzero )
3004 IF( tri )
3005 $ a( j, j ) = a( j, j ) + one
3006 IF( unit )
3007 $ a( j, j ) = one
3008 20 CONTINUE
3009
3010
3011
3012 IF( type.EQ.'GE' )THEN
3013 DO 50 j = 1, n
3014 DO 30 i = 1, m
3015 aa( i + ( j - 1 )*lda ) = a( i, j )
3016 30 CONTINUE
3017 DO 40 i = m + 1, lda
3018 aa( i + ( j - 1 )*lda ) = rogue
3019 40 CONTINUE
3020 50 CONTINUE
3021 ELSE IF( type.EQ.'HE'.OR.type.EQ.'SY'.OR.type.EQ.'TR' )THEN
3022 DO 90 j = 1, n
3023 IF( upper )THEN
3024 ibeg = 1
3025 IF( unit )THEN
3026 iend = j - 1
3027 ELSE
3028 iend = j
3029 END IF
3030 ELSE
3031 IF( unit )THEN
3032 ibeg = j + 1
3033 ELSE
3034 ibeg = j
3035 END IF
3036 iend = n
3037 END IF
3038 DO 60 i = 1, ibeg - 1
3039 aa( i + ( j - 1 )*lda ) = rogue
3040 60 CONTINUE
3041 DO 70 i = ibeg, iend
3042 aa( i + ( j - 1 )*lda ) = a( i, j )
3043 70 CONTINUE
3044 DO 80 i = iend + 1, lda
3045 aa( i + ( j - 1 )*lda ) = rogue
3046 80 CONTINUE
3047 IF( her )THEN
3048 jj = j + ( j - 1 )*lda
3049 aa( jj ) = dcmplx( dble( aa( jj ) ), rrogue )
3050 END IF
3051 90 CONTINUE
3052 END IF
3053 RETURN
3054
3055
3056
complex *16 function zbeg(reset)