/home/abui...N/slatme.f(3)
π SLATME.f(3) β Library Functions Manual π
okay bestie, welcome to SLATME.f(3) from the Library Functions Manual β this is the LAPACK test-matrix generator page, and it is lowkey iconic for making random matrices that behave exactly how you told them to. π§β¨
πΈ NAME πΈ
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/TESTING/MATGEN/slatme.f
periodt, that's the file. π
β¨ SYNOPSIS β¨
π«Ά Functions/Subroutines π«Ά
subroutine SLATME (n, dist, iseed, d, mode, cond, dmax, ei, rsign,
upper, sim, ds, modes, conds, kl, ku, anorm, a, lda, work, info)
SLATME
π¦ Function/Subroutine Documentation π¦
bestie, here's the full signature in all its long-but-slaying glory:
subroutine SLATME (integer n, character dist, integer, dimension( 4 ) iseed,
real, dimension( * ) d, integer mode, real cond, real dmax, character,
dimension( * ) ei, character rsign, character upper, character sim,
real, dimension( * ) ds, integer modes, real conds, integer kl, integer
ku, real anorm, real, dimension( lda, * ) a, integer lda, real,
dimension( * ) work, integer info)
SLATME
π Purpose π
SLATME generates random non-symmetric square matrices with specified eigenvalues for testing LAPACK programs. no cap, that's the whole glow-up. π
SLATME operates by applying the following sequence of operations:
- Set the diagonal to
D, whereDmay be input or computed according toMODE,COND,DMAX, andRSIGNas described below. - If complex conjugate pairs are desired (
MODE=0andEI(1)='R', orMODE=5), certain pairs of adjacent elements ofDare interpreted as the real and complex parts of a complex conjugate pair;Athus becomes block diagonal, with1x1and2x2blocks. - If
UPPER='T', the upper triangle ofAis set to random values out of distributionDIST. - If
SIM='T',Ais multiplied on the left by a random matrixX, whose singular values are specified byDS,MODES, andCONDS, and on the right byXinverse. - If
KL < N-1, the lower bandwidth is reduced toKLusing Householder transformations. IfKU < N-1, the upper bandwidth is reduced toKU. - If
ANORMis not negative, the matrix is scaled to have maximum-element-normANORM.
Note: since the matrix cannot be reduced beyond Hessenberg form, no packing options are available. π
π Parameters π
β N
N is INTEGER The number of columns (or rows) of A. Not modified. π«Ά
β DIST
DIST is CHARACTER*1 On entry, DIST specifies the type of distribution to be used to generate the random eigen-/singular values, and for the upper triangle (see UPPER).
'U'=>UNIFORM( 0, 1 )('U'for uniform)'S'=>UNIFORM( -1, 1 )('S'for symmetric)'N'=>NORMAL( 0, 1 )('N'for normal)
Not modified.
β ISEED
ISEED is INTEGER array, dimension ( 4 ) On entry ISEED specifies the seed of the random number generator. They should lie between 0 and 4095 inclusive, and ISEED(4) should be odd. The random number generator uses a linear congruential sequence limited to small integers, and so should produce machine independent random numbers. The values of ISEED are changed on exit, and can be used in the next call to SLATME to continue the same random number sequence. Changed on exit. π₯
β D
D is REAL array, dimension ( N ) This array is used to specify the eigenvalues of A. If MODE=0, then D is assumed to contain the eigenvalues (but see the description of EI), otherwise they will be computed according to MODE, COND, DMAX, and RSIGN and placed in D. Modified if MODE is nonzero.
β MODE
MODE is INTEGER On entry this describes how the eigenvalues are to be specified:
MODE = 0means useD(withEI) as inputMODE = 1setsD(1)=1andD(2:N)=1.0/CONDMODE = 2setsD(1:N-1)=1andD(N)=1.0/CONDMODE = 3setsD(I)=COND**(-(I-1)/(N-1))MODE = 4setsD(i)=1 - (i-1)/(N-1)*(1 - 1/COND)MODE = 5setsDto random numbers in the range( 1/COND , 1 )such that their logarithms are uniformly distributed. Each odd-even pair of elements will be either used as two real eigenvalues or as the real and imaginary part of a complex conjugate pair of eigenvalues; the choice of which is done is random, with50-50probability, for each pair.MODE = 6setDto random numbers from same distribution as the rest of the matrix.MODE < 0has the same meaning asABS(MODE), except that the order of the elements ofDis reversed.
Thus if MODE is between 1 and 4, D has entries ranging from 1 to 1/COND, if between -1 and -4, D has entries ranging from 1/COND to 1,
Not modified.
β COND
COND is REAL On entry, this is used as described under MODE above. If used, it must be >= 1. Not modified.
β DMAX
DMAX is REAL If MODE is neither -6, 0 nor 6, the contents of D, as computed according to MODE and COND, will be scaled by DMAX / max(abs(D(i))). Note that DMAX need not be positive: if DMAX is negative (or zero), D will be scaled by a negative number (or zero). Not modified.
β EI
EI is CHARACTER*1 array, dimension ( N ) If MODE is 0, and EI(1) is not ' ' (space character), this array specifies which elements of D (on input) are real eigenvalues and which are the real and imaginary parts of a complex conjugate pair of eigenvalues. The elements of EI may then only have the values 'R' and 'I'. If EI(j)='R' and EI(j+1)='I', then the j-th eigenvalue is CMPLX( D(j) , D(j+1) ), and the (j+1)-th is the complex conjugate thereof. If EI(j)=EI(j+1)='R', then the j-th eigenvalue is D(j) (i.e., real). EI(1) may not be 'I', nor may two adjacent elements of EI both have the value 'I'. If MODE is not 0, then EI is ignored. If MODE is 0 and EI(1)=' ', then the eigenvalues will all be real. Not modified. π
β RSIGN
RSIGN is CHARACTER*1 If MODE is not 0, 6, or -6, and RSIGN='T', then the elements of D, as computed according to MODE and COND, will be multiplied by a random sign (+1 or -1). If RSIGN='F', they will not be. RSIGN may only have the values 'T' or 'F'. Not modified.
β UPPER
UPPER is CHARACTER*1 If UPPER='T', then the elements of A above the diagonal (and above the 2x2 diagonal blocks, if A has complex eigenvalues) will be set to random numbers out of DIST. If UPPER='F', they will not. UPPER may only have the values 'T' or 'F'. Not modified.
β SIM
SIM is CHARACTER*1 If SIM='T', then A will be operated on by a , i.e., multiplied on the left by a matrix X and on the right by X inverse. X = U S V, where U and V are random unitary matrices and S is a (diagonal) matrix of singular values specified by DS, MODES, and CONDS. If SIM='F', then A will not be transformed. Not modified. π (yes, the source really has that lonely a , β i'm just preserving the vibe.)
β DS
DS is REAL array, dimension ( N ) This array is used to specify the singular values of X, in the same way that D specifies the eigenvalues of A. If MODE=0, the DS contains the singular values, which may not be zero. Modified if MODE is nonzero.
β MODES
MODES is INTEGER
that's it, bestie β the source gives this one no extra prose. π
β CONDS
CONDS is REAL Same as MODE and COND, but for specifying the diagonal of S. MODES=-6 and +6 are not allowed (since they would result in randomly ill-conditioned eigenvalues.) π«Ά
β KL
KL is INTEGER This specifies the lower bandwidth of the matrix. KL=1 specifies upper Hessenberg form. If KL is at least N-1, then A will have full lower bandwidth. KL must be at least 1. Not modified.
β KU
KU is INTEGER This specifies the upper bandwidth of the matrix. KU=1 specifies lower Hessenberg form. If KU is at least N-1, then A will have full upper bandwidth; if KU and KL are both at least N-1, then A will be dense. Only one of KU and KL may be less than N-1. KU must be at least 1. Not modified. π₯
β ANORM
ANORM is REAL If ANORM is not negative, then A will be scaled by a non-negative real number to make the maximum-element-norm of A to be ANORM. Not modified.
β A
A is REAL array, dimension ( LDA, N ) On exit A is the desired test matrix. Modified. β¨
β LDA
LDA is INTEGER LDA specifies the first dimension of A as declared in the calling program. LDA must be at least N. Not modified.
β WORK
WORKβ aREALarray, dimension( 3*N ), and it's the workspace bestie π it gets modified in place, so don't come crying when your numbers look different afterwards, that's just how it is.
π INFO π
INFO is an INTEGER β the vibe report π«Ά it's the error code, and on exit, INFO gets set to one of these bad boys:
0=> normal return β we ate, no notes β¨-1=>Nnegative π-2=>DISTillegal string-5=>MODEnot in range-6to6-6=>CONDless than1.0, andMODEneither-6,0nor6-8=>EI(1)is not' 'or'R',EI(j)is not'R'or'I', or two adjacent elements ofEIare'I'-9=>RSIGNis not'T'or'F'-10=>UPPERis not'T'or'F'-11=>SIMis not'T'or'F'-12=>MODES=0andDShas a zero singular value π-13=>MODESis not in the range-5to5-14=>MODESis nonzero andCONDSis less than1-15=>KLis less than1-16=>KUis less than1, orKLandKUare both less thanN-1-19=>LDAis less thanN1=> error return fromSLATM1(computingD)2=> cannot scale toDMAX(max. eigenvalue is0)3=> error return fromSLATM1(computingDS)4=> error return fromSLARGE5=> zero singular value fromSLATM1
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 327 of file slatme.f.
πΈ Author πΈ
Generated automatically by Doxygen for LAPACK from the source code β shoutout to the robot that wrote the docs so the humans didn't have to π€π
ok that's the whole page bestie, go forth and call SLATME responsibly π¦
LAPACK, Version 3.12.0 β and yeah this page lives at /home/abui...N/slatme.f(3), that's the one right there π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms