144 SUBROUTINE dlascl( TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO )
153 INTEGER INFO, KL, KU, LDA, M, N
154 DOUBLE PRECISION CFROM, CTO
157 DOUBLE PRECISION A( lda, * )
163 DOUBLE PRECISION ZERO, ONE
164 parameter ( zero = 0.0d0, one = 1.0d0 )
168 INTEGER I, ITYPE, J, K1, K2, K3, K4
169 DOUBLE PRECISION BIGNUM, CFROM1, CFROMC, CTO1, CTOC, MUL, SMLNUM
172 LOGICAL LSAME, DISNAN
173 DOUBLE PRECISION DLAMCH
174 EXTERNAL lsame, dlamch, disnan
177 INTRINSIC abs, max, min
188 IF( lsame(
TYPE,
'G' ) ) then
190 ELSE IF( lsame(
TYPE,
'L' ) ) then
192 ELSE IF( lsame(
TYPE,
'U' ) ) then
194 ELSE IF( lsame(
TYPE,
'H' ) ) then
196 ELSE IF( lsame(
TYPE,
'B' ) ) then
198 ELSE IF( lsame(
TYPE,
'Q' ) ) then
200 ELSE IF( lsame(
TYPE,
'Z' ) ) then
206 IF( itype.EQ.-1 )
THEN
208 ELSE IF( cfrom.EQ.zero .OR. disnan(cfrom) )
THEN
210 ELSE IF( disnan(cto) )
THEN
212 ELSE IF( m.LT.0 )
THEN
214 ELSE IF( n.LT.0 .OR. ( itype.EQ.4 .AND. n.NE.m ) .OR.
215 $ ( itype.EQ.5 .AND. n.NE.m ) )
THEN
217 ELSE IF( itype.LE.3 .AND. lda.LT.max( 1, m ) )
THEN
219 ELSE IF( itype.GE.4 )
THEN
220 IF( kl.LT.0 .OR. kl.GT.max( m-1, 0 ) )
THEN
222 ELSE IF( ku.LT.0 .OR. ku.GT.max( n-1, 0 ) .OR.
223 $ ( ( itype.EQ.4 .OR. itype.EQ.5 ) .AND. kl.NE.ku ) )
226 ELSE IF( ( itype.EQ.4 .AND. lda.LT.kl+1 ) .OR.
227 $ ( itype.EQ.5 .AND. lda.LT.ku+1 ) .OR.
228 $ ( itype.EQ.6 .AND. lda.LT.2*kl+ku+1 ) )
THEN
234 CALL xerbla(
'DLASCL', -info )
240 IF( n.EQ.0 .OR. m.EQ.0 )
245 smlnum = dlamch(
'S' )
246 bignum = one / smlnum
252 cfrom1 = cfromc*smlnum
253 IF( cfrom1.EQ.cfromc )
THEN
261 IF( cto1.EQ.ctoc )
THEN
267 ELSE IF( abs( cfrom1 ).GT.abs( ctoc ) .AND. ctoc.NE.zero )
THEN
271 ELSE IF( abs( cto1 ).GT.abs( cfromc ) )
THEN
281 IF( itype.EQ.0 )
THEN
287 a( i, j ) = a( i, j )*mul
291 ELSE IF( itype.EQ.1 )
THEN
297 a( i, j ) = a( i, j )*mul
301 ELSE IF( itype.EQ.2 )
THEN
306 DO 60 i = 1, min( j, m )
307 a( i, j ) = a( i, j )*mul
311 ELSE IF( itype.EQ.3 )
THEN
316 DO 80 i = 1, min( j+1, m )
317 a( i, j ) = a( i, j )*mul
321 ELSE IF( itype.EQ.4 )
THEN
328 DO 100 i = 1, min( k3, k4-j )
329 a( i, j ) = a( i, j )*mul
333 ELSE IF( itype.EQ.5 )
THEN
340 DO 120 i = max( k1-j, 1 ), k3
341 a( i, j ) = a( i, j )*mul
345 ELSE IF( itype.EQ.6 )
THEN
354 DO 140 i = max( k1-j, k2 ), min( k3, k4-j )
355 a( i, j ) = a( i, j )*mul
subroutine dlascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
DLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine xerbla(SRNAME, INFO)
XERBLA