2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410 REAL ZERO, ONE
2411 parameter( zero = 0.0, one = 1.0 )
2412 REAL ROGUE
2413 parameter( rogue = -1.0e10 )
2414
2415 REAL TRANSL
2416 INTEGER LDA, M, N, NMAX
2417 LOGICAL RESET
2418 CHARACTER*1 DIAG, UPLO
2419 CHARACTER*2 TYPE
2420
2421 REAL A( NMAX, * ), AA( * )
2422
2423 INTEGER I, IBEG, IEND, J
2424 LOGICAL GEN, LOWER, SYM, TRI, UNIT, UPPER
2425
2426 REAL SBEG
2428
2429 gen = type.EQ.'GE'
2430 sym = type.EQ.'SY'
2431 tri = type.EQ.'TR'
2432 upper = ( sym.OR.tri ).AND.uplo.EQ.'U'
2433 lower = ( sym.OR.tri ).AND.uplo.EQ.'L'
2434 unit = tri.AND.diag.EQ.'U'
2435
2436
2437
2438 DO 20 j = 1, n
2439 DO 10 i = 1, m
2440 IF( gen.OR.( upper.AND.i.LE.j ).OR.( lower.AND.i.GE.j ) )
2441 $ THEN
2442 a( i, j ) =
sbeg( reset ) + transl
2443 IF( i.NE.j )THEN
2444
2445 IF( n.GT.3.AND.j.EQ.n/2 )
2446 $ a( i, j ) = zero
2447 IF( sym )THEN
2448 a( j, i ) = a( i, j )
2449 ELSE IF( tri )THEN
2450 a( j, i ) = zero
2451 END IF
2452 END IF
2453 END IF
2454 10 CONTINUE
2455 IF( tri )
2456 $ a( j, j ) = a( j, j ) + one
2457 IF( unit )
2458 $ a( j, j ) = one
2459 20 CONTINUE
2460
2461
2462
2463 IF( type.EQ.'GE' )THEN
2464 DO 50 j = 1, n
2465 DO 30 i = 1, m
2466 aa( i + ( j - 1 )*lda ) = a( i, j )
2467 30 CONTINUE
2468 DO 40 i = m + 1, lda
2469 aa( i + ( j - 1 )*lda ) = rogue
2470 40 CONTINUE
2471 50 CONTINUE
2472 ELSE IF( type.EQ.'SY'.OR.type.EQ.'TR' )THEN
2473 DO 90 j = 1, n
2474 IF( upper )THEN
2475 ibeg = 1
2476 IF( unit )THEN
2477 iend = j - 1
2478 ELSE
2479 iend = j
2480 END IF
2481 ELSE
2482 IF( unit )THEN
2483 ibeg = j + 1
2484 ELSE
2485 ibeg = j
2486 END IF
2487 iend = n
2488 END IF
2489 DO 60 i = 1, ibeg - 1
2490 aa( i + ( j - 1 )*lda ) = rogue
2491 60 CONTINUE
2492 DO 70 i = ibeg, iend
2493 aa( i + ( j - 1 )*lda ) = a( i, j )
2494 70 CONTINUE
2495 DO 80 i = iend + 1, lda
2496 aa( i + ( j - 1 )*lda ) = rogue
2497 80 CONTINUE
2498 90 CONTINUE
2499 END IF
2500 RETURN
2501
2502
2503
real function sbeg(reset)