LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ smake()

subroutine smake ( character*2 type,
character*1 uplo,
character*1 diag,
integer m,
integer n,
real, dimension( nmax, * ) a,
integer nmax,
real, dimension( * ) aa,
integer lda,
logical reset,
real transl )

Definition at line 2478 of file sblat3.f.

2480*
2481* Generates values for an M by N matrix A.
2482* Stores the values in the array AA in the data structure required
2483* by the routine, with unwanted elements set to rogue value.
2484*
2485* TYPE is 'GE', 'SY' or 'TR'.
2486*
2487* Auxiliary routine for test program for Level 3 Blas.
2488*
2489* -- Written on 8-February-1989.
2490* Jack Dongarra, Argonne National Laboratory.
2491* Iain Duff, AERE Harwell.
2492* Jeremy Du Croz, Numerical Algorithms Group Ltd.
2493* Sven Hammarling, Numerical Algorithms Group Ltd.
2494*
2495* .. Parameters ..
2496 REAL ZERO, ONE
2497 parameter( zero = 0.0, one = 1.0 )
2498 REAL ROGUE
2499 parameter( rogue = -1.0e10 )
2500* .. Scalar Arguments ..
2501 REAL TRANSL
2502 INTEGER LDA, M, N, NMAX
2503 LOGICAL RESET
2504 CHARACTER*1 DIAG, UPLO
2505 CHARACTER*2 TYPE
2506* .. Array Arguments ..
2507 REAL A( NMAX, * ), AA( * )
2508* .. Local Scalars ..
2509 INTEGER I, IBEG, IEND, J
2510 LOGICAL GEN, LOWER, SYM, TRI, UNIT, UPPER
2511* .. External Functions ..
2512 REAL SBEG
2513 EXTERNAL sbeg
2514* .. Executable Statements ..
2515 gen = type.EQ.'GE'
2516 sym = type.EQ.'SY'
2517 tri = type.EQ.'TR'
2518 upper = ( sym.OR.tri ).AND.uplo.EQ.'U'
2519 lower = ( sym.OR.tri ).AND.uplo.EQ.'L'
2520 unit = tri.AND.diag.EQ.'U'
2521*
2522* Generate data in array A.
2523*
2524 DO 20 j = 1, n
2525 DO 10 i = 1, m
2526 IF( gen.OR.( upper.AND.i.LE.j ).OR.( lower.AND.i.GE.j ) )
2527 $ THEN
2528 a( i, j ) = sbeg( reset ) + transl
2529 IF( i.NE.j )THEN
2530* Set some elements to zero
2531 IF( n.GT.3.AND.j.EQ.n/2 )
2532 $ a( i, j ) = zero
2533 IF( sym )THEN
2534 a( j, i ) = a( i, j )
2535 ELSE IF( tri )THEN
2536 a( j, i ) = zero
2537 END IF
2538 END IF
2539 END IF
2540 10 CONTINUE
2541 IF( tri )
2542 $ a( j, j ) = a( j, j ) + one
2543 IF( unit )
2544 $ a( j, j ) = one
2545 20 CONTINUE
2546*
2547* Store elements in array AS in data structure required by routine.
2548*
2549 IF( type.EQ.'GE' )THEN
2550 DO 50 j = 1, n
2551 DO 30 i = 1, m
2552 aa( i + ( j - 1 )*lda ) = a( i, j )
2553 30 CONTINUE
2554 DO 40 i = m + 1, lda
2555 aa( i + ( j - 1 )*lda ) = rogue
2556 40 CONTINUE
2557 50 CONTINUE
2558 ELSE IF( type.EQ.'SY'.OR.type.EQ.'TR' )THEN
2559 DO 90 j = 1, n
2560 IF( upper )THEN
2561 ibeg = 1
2562 IF( unit )THEN
2563 iend = j - 1
2564 ELSE
2565 iend = j
2566 END IF
2567 ELSE
2568 IF( unit )THEN
2569 ibeg = j + 1
2570 ELSE
2571 ibeg = j
2572 END IF
2573 iend = n
2574 END IF
2575 DO 60 i = 1, ibeg - 1
2576 aa( i + ( j - 1 )*lda ) = rogue
2577 60 CONTINUE
2578 DO 70 i = ibeg, iend
2579 aa( i + ( j - 1 )*lda ) = a( i, j )
2580 70 CONTINUE
2581 DO 80 i = iend + 1, lda
2582 aa( i + ( j - 1 )*lda ) = rogue
2583 80 CONTINUE
2584 90 CONTINUE
2585 END IF
2586 RETURN
2587*
2588* End of SMAKE
2589*
real function sbeg(reset)
Definition sblat2.f:3059