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 2105 of file c_sblat3.f.

2107*
2108* Generates values for an M by N matrix A.
2109* Stores the values in the array AA in the data structure required
2110* by the routine, with unwanted elements set to rogue value.
2111*
2112* TYPE is 'GE', 'SY' or 'TR'.
2113*
2114* Auxiliary routine for test program for Level 3 Blas.
2115*
2116* -- Written on 8-February-1989.
2117* Jack Dongarra, Argonne National Laboratory.
2118* Iain Duff, AERE Harwell.
2119* Jeremy Du Croz, Numerical Algorithms Group Ltd.
2120* Sven Hammarling, Numerical Algorithms Group Ltd.
2121*
2122* .. Parameters ..
2123 REAL ZERO, ONE
2124 parameter( zero = 0.0, one = 1.0 )
2125 REAL ROGUE
2126 parameter( rogue = -1.0e10 )
2127* .. Scalar Arguments ..
2128 REAL TRANSL
2129 INTEGER LDA, M, N, NMAX
2130 LOGICAL RESET
2131 CHARACTER*1 DIAG, UPLO
2132 CHARACTER*2 TYPE
2133* .. Array Arguments ..
2134 REAL A( NMAX, * ), AA( * )
2135* .. Local Scalars ..
2136 INTEGER I, IBEG, IEND, J
2137 LOGICAL GEN, LOWER, SYM, TRI, UNIT, UPPER
2138* .. External Functions ..
2139 REAL SBEG
2140 EXTERNAL sbeg
2141* .. Executable Statements ..
2142 gen = type.EQ.'GE'
2143 sym = type.EQ.'SY'
2144 tri = type.EQ.'TR'
2145 upper = ( sym.OR.tri ).AND.uplo.EQ.'U'
2146 lower = ( sym.OR.tri ).AND.uplo.EQ.'L'
2147 unit = tri.AND.diag.EQ.'U'
2148*
2149* Generate data in array A.
2150*
2151 DO 20 j = 1, n
2152 DO 10 i = 1, m
2153 IF( gen.OR.( upper.AND.i.LE.j ).OR.( lower.AND.i.GE.j ) )
2154 $ THEN
2155 a( i, j ) = sbeg( reset ) + transl
2156 IF( i.NE.j )THEN
2157* Set some elements to zero
2158 IF( n.GT.3.AND.j.EQ.n/2 )
2159 $ a( i, j ) = zero
2160 IF( sym )THEN
2161 a( j, i ) = a( i, j )
2162 ELSE IF( tri )THEN
2163 a( j, i ) = zero
2164 END IF
2165 END IF
2166 END IF
2167 10 CONTINUE
2168 IF( tri )
2169 $ a( j, j ) = a( j, j ) + one
2170 IF( unit )
2171 $ a( j, j ) = one
2172 20 CONTINUE
2173*
2174* Store elements in array AS in data structure required by routine.
2175*
2176 IF( type.EQ.'GE' )THEN
2177 DO 50 j = 1, n
2178 DO 30 i = 1, m
2179 aa( i + ( j - 1 )*lda ) = a( i, j )
2180 30 CONTINUE
2181 DO 40 i = m + 1, lda
2182 aa( i + ( j - 1 )*lda ) = rogue
2183 40 CONTINUE
2184 50 CONTINUE
2185 ELSE IF( type.EQ.'SY'.OR.type.EQ.'TR' )THEN
2186 DO 90 j = 1, n
2187 IF( upper )THEN
2188 ibeg = 1
2189 IF( unit )THEN
2190 iend = j - 1
2191 ELSE
2192 iend = j
2193 END IF
2194 ELSE
2195 IF( unit )THEN
2196 ibeg = j + 1
2197 ELSE
2198 ibeg = j
2199 END IF
2200 iend = n
2201 END IF
2202 DO 60 i = 1, ibeg - 1
2203 aa( i + ( j - 1 )*lda ) = rogue
2204 60 CONTINUE
2205 DO 70 i = ibeg, iend
2206 aa( i + ( j - 1 )*lda ) = a( i, j )
2207 70 CONTINUE
2208 DO 80 i = iend + 1, lda
2209 aa( i + ( j - 1 )*lda ) = rogue
2210 80 CONTINUE
2211 90 CONTINUE
2212 END IF
2213 RETURN
2214*
2215* End of SMAKE.
2216*
real function sbeg(reset)
Definition sblat2.f:3059