140 SUBROUTINE slascl( TYPE, KL, KU, CFROM, CTO, M, N, A, LDA,
149 INTEGER INFO, KL, KU, LDA, M, N
160 parameter( zero = 0.0e0, one = 1.0e0 )
164 INTEGER I, ITYPE, J, K1, K2, K3, K4
165 REAL BIGNUM, CFROM1, CFROMC, CTO1, CTOC, MUL, SMLNUM
168 LOGICAL LSAME, SISNAN
170 EXTERNAL lsame, slamch, sisnan
173 INTRINSIC abs, max, min
184 IF( lsame(
TYPE,
'G' ) ) then
186 ELSE IF( lsame(
TYPE,
'L' ) ) then
188 ELSE IF( lsame(
TYPE,
'U' ) ) then
190 ELSE IF( lsame(
TYPE,
'H' ) ) then
192 ELSE IF( lsame(
TYPE,
'B' ) ) then
194 ELSE IF( lsame(
TYPE,
'Q' ) ) then
196 ELSE IF( lsame(
TYPE,
'Z' ) ) then
202 IF( itype.EQ.-1 )
THEN
204 ELSE IF( cfrom.EQ.zero .OR. sisnan(cfrom) )
THEN
206 ELSE IF( sisnan(cto) )
THEN
208 ELSE IF( m.LT.0 )
THEN
210 ELSE IF( n.LT.0 .OR. ( itype.EQ.4 .AND. n.NE.m ) .OR.
211 $ ( itype.EQ.5 .AND. n.NE.m ) )
THEN
213 ELSE IF( itype.LE.3 .AND. lda.LT.max( 1, m ) )
THEN
215 ELSE IF( itype.GE.4 )
THEN
216 IF( kl.LT.0 .OR. kl.GT.max( m-1, 0 ) )
THEN
218 ELSE IF( ku.LT.0 .OR. ku.GT.max( n-1, 0 ) .OR.
219 $ ( ( itype.EQ.4 .OR. itype.EQ.5 ) .AND. kl.NE.ku ) )
222 ELSE IF( ( itype.EQ.4 .AND. lda.LT.kl+1 ) .OR.
223 $ ( itype.EQ.5 .AND. lda.LT.ku+1 ) .OR.
224 $ ( itype.EQ.6 .AND. lda.LT.2*kl+ku+1 ) )
THEN
230 CALL xerbla(
'SLASCL', -info )
236 IF( n.EQ.0 .OR. m.EQ.0 )
241 smlnum = slamch(
'S' )
242 bignum = one / smlnum
248 cfrom1 = cfromc*smlnum
249 IF( cfrom1.EQ.cfromc )
THEN
257 IF( cto1.EQ.ctoc )
THEN
263 ELSE IF( abs( cfrom1 ).GT.abs( ctoc ) .AND. ctoc.NE.zero )
THEN
267 ELSE IF( abs( cto1 ).GT.abs( cfromc ) )
THEN
279 IF( itype.EQ.0 )
THEN
285 a( i, j ) = a( i, j )*mul
289 ELSE IF( itype.EQ.1 )
THEN
295 a( i, j ) = a( i, j )*mul
299 ELSE IF( itype.EQ.2 )
THEN
304 DO 60 i = 1, min( j, m )
305 a( i, j ) = a( i, j )*mul
309 ELSE IF( itype.EQ.3 )
THEN
314 DO 80 i = 1, min( j+1, m )
315 a( i, j ) = a( i, j )*mul
319 ELSE IF( itype.EQ.4 )
THEN
326 DO 100 i = 1, min( k3, k4-j )
327 a( i, j ) = a( i, j )*mul
331 ELSE IF( itype.EQ.5 )
THEN
338 DO 120 i = max( k1-j, 1 ), k3
339 a( i, j ) = a( i, j )*mul
343 ELSE IF( itype.EQ.6 )
THEN
352 DO 140 i = max( k1-j, k2 ), min( k3, k4-j )
353 a( i, j ) = a( i, j )*mul
subroutine slascl(type, kl, ku, cfrom, cto, m, n, a, lda, info)
SLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.