00001 REAL FUNCTION CLA_GBRCOND_C( TRANS, N, KL, KU, AB, LDAB, AFB,
00002 $ LDAFB, IPIV, C, CAPPLY, INFO, WORK,
00003 $ RWORK )
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 IMPLICIT NONE
00014
00015
00016 CHARACTER TRANS
00017 LOGICAL CAPPLY
00018 INTEGER N, KL, KU, KD, KE, LDAB, LDAFB, INFO
00019
00020
00021 INTEGER IPIV( * )
00022 COMPLEX AB( LDAB, * ), AFB( LDAFB, * ), WORK( * )
00023 REAL C( * ), RWORK( * )
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 LOGICAL NOTRANS
00095 INTEGER KASE, I, J
00096 REAL AINVNM, ANORM, TMP
00097 COMPLEX ZDUM
00098
00099
00100 INTEGER ISAVE( 3 )
00101
00102
00103 LOGICAL LSAME
00104 EXTERNAL LSAME
00105
00106
00107 EXTERNAL CLACN2, CGBTRS, XERBLA
00108
00109
00110 INTRINSIC ABS, MAX
00111
00112
00113 REAL CABS1
00114
00115
00116 CABS1( ZDUM ) = ABS( REAL( ZDUM ) ) + ABS( AIMAG( ZDUM ) )
00117
00118
00119 CLA_GBRCOND_C = 0.0E+0
00120
00121 INFO = 0
00122 NOTRANS = LSAME( TRANS, 'N' )
00123 IF ( .NOT. NOTRANS .AND. .NOT. LSAME( TRANS, 'T' ) .AND. .NOT.
00124 $ LSAME( TRANS, 'C' ) ) THEN
00125 INFO = -1
00126 ELSE IF( N.LT.0 ) THEN
00127 INFO = -2
00128 ELSE IF( KL.LT.0 .OR. KL.GT.N-1 ) THEN
00129 INFO = -3
00130 ELSE IF( KU.LT.0 .OR. KU.GT.N-1 ) THEN
00131 INFO = -4
00132 ELSE IF( LDAB.LT.KL+KU+1 ) THEN
00133 INFO = -6
00134 ELSE IF( LDAFB.LT.2*KL+KU+1 ) THEN
00135 INFO = -8
00136 END IF
00137 IF( INFO.NE.0 ) THEN
00138 CALL XERBLA( 'CLA_GBRCOND_C', -INFO )
00139 RETURN
00140 END IF
00141
00142
00143
00144 ANORM = 0.0E+0
00145 KD = KU + 1
00146 KE = KL + 1
00147 IF ( NOTRANS ) THEN
00148 DO I = 1, N
00149 TMP = 0.0E+0
00150 IF ( CAPPLY ) THEN
00151 DO J = MAX( I-KL, 1 ), MIN( I+KU, N )
00152 TMP = TMP + CABS1( AB( KD+I-J, J ) ) / C( J )
00153 END DO
00154 ELSE
00155 DO J = MAX( I-KL, 1 ), MIN( I+KU, N )
00156 TMP = TMP + CABS1( AB( KD+I-J, J ) )
00157 END DO
00158 END IF
00159 RWORK( I ) = TMP
00160 ANORM = MAX( ANORM, TMP )
00161 END DO
00162 ELSE
00163 DO I = 1, N
00164 TMP = 0.0E+0
00165 IF ( CAPPLY ) THEN
00166 DO J = MAX( I-KL, 1 ), MIN( I+KU, N )
00167 TMP = TMP + CABS1( AB( KE-I+J, I ) ) / C( J )
00168 END DO
00169 ELSE
00170 DO J = MAX( I-KL, 1 ), MIN( I+KU, N )
00171 TMP = TMP + CABS1( AB( KE-I+J, I ) )
00172 END DO
00173 END IF
00174 RWORK( I ) = TMP
00175 ANORM = MAX( ANORM, TMP )
00176 END DO
00177 END IF
00178
00179
00180
00181 IF( N.EQ.0 ) THEN
00182 CLA_GBRCOND_C = 1.0E+0
00183 RETURN
00184 ELSE IF( ANORM .EQ. 0.0E+0 ) THEN
00185 RETURN
00186 END IF
00187
00188
00189
00190 AINVNM = 0.0E+0
00191
00192 KASE = 0
00193 10 CONTINUE
00194 CALL CLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
00195 IF( KASE.NE.0 ) THEN
00196 IF( KASE.EQ.2 ) THEN
00197
00198
00199
00200 DO I = 1, N
00201 WORK( I ) = WORK( I ) * RWORK( I )
00202 END DO
00203
00204 IF ( NOTRANS ) THEN
00205 CALL CGBTRS( 'No transpose', N, KL, KU, 1, AFB, LDAFB,
00206 $ IPIV, WORK, N, INFO )
00207 ELSE
00208 CALL CGBTRS( 'Conjugate transpose', N, KL, KU, 1, AFB,
00209 $ LDAFB, IPIV, WORK, N, INFO )
00210 ENDIF
00211
00212
00213
00214 IF ( CAPPLY ) THEN
00215 DO I = 1, N
00216 WORK( I ) = WORK( I ) * C( I )
00217 END DO
00218 END IF
00219 ELSE
00220
00221
00222
00223 IF ( CAPPLY ) THEN
00224 DO I = 1, N
00225 WORK( I ) = WORK( I ) * C( I )
00226 END DO
00227 END IF
00228
00229 IF ( NOTRANS ) THEN
00230 CALL CGBTRS( 'Conjugate transpose', N, KL, KU, 1, AFB,
00231 $ LDAFB, IPIV, WORK, N, INFO )
00232 ELSE
00233 CALL CGBTRS( 'No transpose', N, KL, KU, 1, AFB, LDAFB,
00234 $ IPIV, WORK, N, INFO )
00235 END IF
00236
00237
00238
00239 DO I = 1, N
00240 WORK( I ) = WORK( I ) * RWORK( I )
00241 END DO
00242 END IF
00243 GO TO 10
00244 END IF
00245
00246
00247
00248 IF( AINVNM .NE. 0.0E+0 )
00249 $ CLA_GBRCOND_C = 1.0E+0 / AINVNM
00250
00251 RETURN
00252
00253 END