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

◆ slatb9()

subroutine slatb9 ( character*3  path,
integer  imat,
integer  m,
integer  p,
integer  n,
character  type,
integer  kla,
integer  kua,
integer  klb,
integer  kub,
real  anorm,
real  bnorm,
integer  modea,
integer  modeb,
real  cndnma,
real  cndnmb,
character  dista,
character  distb 
)

SLATB9

Purpose:
 SLATB9 sets parameters for the matrix generator based on the type of
 matrix to be generated.
Parameters
[in]PATH
          PATH is CHARACTER*3
          The LAPACK path name.
[in]IMAT
          IMAT is INTEGER
          An integer key describing which matrix to generate for this
          path.
          = 1:   A: diagonal, B: upper triangular
          = 2:   A: upper triangular, B: upper triangular
          = 3:   A: lower triangular, B: upper triangular
          Else:  A: general dense, B: general dense
[in]M
          M is INTEGER
          The number of rows in the matrix to be generated.
[in]P
          P is INTEGER
[in]N
          N is INTEGER
          The number of columns in the matrix to be generated.
[out]TYPE
          TYPE is CHARACTER*1
          The type of the matrix to be generated:
          = 'S':  symmetric matrix;
          = 'P':  symmetric positive (semi)definite matrix;
          = 'N':  nonsymmetric matrix.
[out]KLA
          KLA is INTEGER
          The lower band width of the matrix to be generated.
[out]KUA
          KUA is INTEGER
          The upper band width of the matrix to be generated.
[out]KLB
          KLB is INTEGER
          The lower band width of the matrix to be generated.
[out]KUB
          KUA is INTEGER
          The upper band width of the matrix to be generated.
[out]ANORM
          ANORM is REAL
          The desired norm of the matrix to be generated.  The diagonal
          matrix of singular values or eigenvalues is scaled by this
          value.
[out]BNORM
          BNORM is REAL
          The desired norm of the matrix to be generated.  The diagonal
          matrix of singular values or eigenvalues is scaled by this
          value.
[out]MODEA
          MODEA is INTEGER
          A key indicating how to choose the vector of eigenvalues.
[out]MODEB
          MODEB is INTEGER
          A key indicating how to choose the vector of eigenvalues.
[out]CNDNMA
          CNDNMA is REAL
          The desired condition number.
[out]CNDNMB
          CNDNMB is REAL
          The desired condition number.
[out]DISTA
          DISTA is CHARACTER*1
          The type of distribution to be used by the random number
          generator.
[out]DISTB
          DISTB is CHARACTER*1
          The type of distribution to be used by the random number
          generator.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 167 of file slatb9.f.

170*
171* -- LAPACK test routine --
172* -- LAPACK is a software package provided by Univ. of Tennessee, --
173* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
174*
175* .. Scalar Arguments ..
176 CHARACTER DISTA, DISTB, TYPE
177 CHARACTER*3 PATH
178 INTEGER IMAT, KLA, KUA, KLB, KUB, M, P, MODEA, MODEB, N
179 REAL ANORM, BNORM, CNDNMA, CNDNMB
180* ..
181*
182* =====================================================================
183*
184* .. Parameters ..
185 REAL SHRINK, TENTH
186 parameter( shrink = 0.25e0, tenth = 0.1e+0 )
187 REAL ONE, TEN
188 parameter( one = 1.0e+0, ten = 1.0e+1 )
189* ..
190* .. Local Scalars ..
191 LOGICAL FIRST
192 REAL BADC1, BADC2, EPS, LARGE, SMALL
193* ..
194* .. External Functions ..
195 LOGICAL LSAMEN
196 REAL SLAMCH
197 EXTERNAL lsamen, slamch
198* ..
199* .. Intrinsic Functions ..
200 INTRINSIC max, sqrt
201* ..
202* .. Save statement ..
203 SAVE eps, small, large, badc1, badc2, first
204* ..
205* .. Data statements ..
206 DATA first / .true. /
207* ..
208* .. Executable Statements ..
209*
210* Set some constants for use in the subroutine.
211*
212 IF( first ) THEN
213 first = .false.
214 eps = slamch( 'Precision' )
215 badc2 = tenth / eps
216 badc1 = sqrt( badc2 )
217 small = slamch( 'Safe minimum' )
218 large = one / small
219 small = shrink*( small / eps )
220 large = one / small
221 END IF
222*
223* Set some parameters we don't plan to change.
224*
225 TYPE = 'N'
226 dista = 'S'
227 distb = 'S'
228 modea = 3
229 modeb = 4
230*
231* Set the lower and upper bandwidths.
232*
233 IF( lsamen( 3, path, 'GRQ') .OR. lsamen( 3, path, 'LSE') .OR.
234 $ lsamen( 3, path, 'GSV') )THEN
235*
236* A: M by N, B: P by N
237*
238 IF( imat.EQ.1 ) THEN
239*
240* A: diagonal, B: upper triangular
241*
242 kla = 0
243 kua = 0
244 klb = 0
245 kub = max( n-1,0 )
246*
247 ELSE IF( imat.EQ.2 ) THEN
248*
249* A: upper triangular, B: upper triangular
250*
251 kla = 0
252 kua = max( n-1, 0 )
253 klb = 0
254 kub = max( n-1, 0 )
255*
256 ELSE IF( imat.EQ.3 ) THEN
257*
258* A: lower triangular, B: upper triangular
259*
260 kla = max( m-1, 0 )
261 kua = 0
262 klb = 0
263 kub = max( n-1, 0 )
264*
265 ELSE
266*
267* A: general dense, B: general dense
268*
269 kla = max( m-1, 0 )
270 kua = max( n-1, 0 )
271 klb = max( p-1, 0 )
272 kub = max( n-1, 0 )
273*
274 END IF
275*
276 ELSE IF( lsamen( 3, path, 'GQR' ) .OR.
277 $ lsamen( 3, path, 'GLM') )THEN
278*
279* A: N by M, B: N by P
280*
281 IF( imat.EQ.1 ) THEN
282*
283* A: diagonal, B: lower triangular
284*
285 kla = 0
286 kua = 0
287 klb = max( n-1,0 )
288 kub = 0
289 ELSE IF( imat.EQ.2 ) THEN
290*
291* A: lower triangular, B: diagonal
292*
293 kla = max( n-1, 0 )
294 kua = 0
295 klb = 0
296 kub = 0
297*
298 ELSE IF( imat.EQ.3 ) THEN
299*
300* A: lower triangular, B: upper triangular
301*
302 kla = max( n-1, 0 )
303 kua = 0
304 klb = 0
305 kub = max( p-1, 0 )
306*
307 ELSE
308*
309* A: general dense, B: general dense
310*
311 kla = max( n-1, 0 )
312 kua = max( m-1, 0 )
313 klb = max( n-1, 0 )
314 kub = max( p-1, 0 )
315 END IF
316*
317 END IF
318*
319* Set the condition number and norm.
320*
321 cndnma = ten*ten
322 cndnmb = ten
323 IF( lsamen( 3, path, 'GQR') .OR. lsamen( 3, path, 'GRQ') .OR.
324 $ lsamen( 3, path, 'GSV') )THEN
325 IF( imat.EQ.5 ) THEN
326 cndnma = badc1
327 cndnmb = badc1
328 ELSE IF( imat.EQ.6 ) THEN
329 cndnma = badc2
330 cndnmb = badc2
331 ELSE IF( imat.EQ.7 ) THEN
332 cndnma = badc1
333 cndnmb = badc2
334 ELSE IF( imat.EQ.8 ) THEN
335 cndnma = badc2
336 cndnmb = badc1
337 END IF
338 END IF
339*
340 anorm = ten
341 bnorm = ten*ten*ten
342 IF( lsamen( 3, path, 'GQR') .OR. lsamen( 3, path, 'GRQ') )THEN
343 IF( imat.EQ.7 ) THEN
344 anorm = small
345 bnorm = large
346 ELSE IF( imat.EQ.8 ) THEN
347 anorm = large
348 bnorm = small
349 END IF
350 END IF
351*
352 IF( n.LE.1 )THEN
353 cndnma = one
354 cndnmb = one
355 END IF
356*
357 RETURN
358*
359* End of SLATB9
360*
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
logical function lsamen(n, ca, cb)
LSAMEN
Definition lsamen.f:74
Here is the caller graph for this function: