TESTING/MATGEN/slatme.f(3)
π NAME π
From the Library Functions Manual, bestie: TESTING/MATGEN/slatme.f β the slatme page. It is literally the file and the subroutine vibe check for SLATME, no cap. π
β¨ 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 π
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 β iconic name, iconic subroutine. β¨
π Purpose π
Okay so hereβs the whole point: SLATME generates random non-symmetric square matrices with specified eigenvalues, and it does this for testing LAPACK programs. π
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βNisINTEGER. The number of columns (or rows) ofA. Not modified.DISTβDISTisCHARACTER*1. On entry,DISTspecifies the type of distribution to be used to generate the random eigen-/singular values, and for the upper triangle (seeUPPER).'U'=>UNIFORM( 0, 1 )('U'for uniform )'S'=>UNIFORM( -1, 1 )('S'for symmetric )'N'=>NORMAL( 0, 1 )('N'for normal )- Not modified.
ISEEDβISEEDisINTEGER array, dimension ( 4 ). On entryISEEDspecifies the seed of the random number generator. They should lie between0and4095inclusive, andISEED(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 ofISEEDare changed on exit, and can be used in the next call toSLATMEto continue the same random number sequence. Changed on exit. π²DβDisREAL array, dimension ( N ). This array is used to specify the eigenvalues ofA. IfMODE=0, thenDis assumed to contain the eigenvalues (but see the description ofEI), otherwise they will be computed according toMODE,COND,DMAX, andRSIGNand placed inD. Modified ifMODEis nonzero.MODEβMODEisINTEGER. 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, with 50-50 probability, 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
MODEis between1and4,Dhas entries ranging from1to1/COND, if between-1and-4,Dhas entries ranging from1/CONDto1. - Not modified.
CONDβCONDisREAL. On entry, this is used as described underMODEabove. If used, it must be>= 1. Not modified.DMAXβDMAXisREAL. IfMODEis neither-6,0nor6, the contents ofD, as computed according toMODEandCOND, will be scaled byDMAX / max(abs(D(i))). Note thatDMAXneed not be positive: ifDMAXis negative (or zero),Dwill be scaled by a negative number (or zero). Not modified. πEIβEIisCHARACTER*1 array, dimension ( N ). IfMODEis0, andEI(1)is not' '(space character), this array specifies which elements ofD(on input) are real eigenvalues and which are the real and imaginary parts of a complex conjugate pair of eigenvalues. The elements ofEImay then only have the values'R'and'I'. IfEI(j)='R'andEI(j+1)='I', then thej-th eigenvalue isCMPLX( D(j) , D(j+1) ), and the(j+1)-th is the complex conjugate thereof. IfEI(j)=EI(j+1)='R', then thej-th eigenvalue isD(j)(i.e., real).EI(1)may not be'I', nor may two adjacent elements ofEIboth have the value'I'. IfMODEis not0, thenEIis ignored. IfMODEis0andEI(1)=' ', then the eigenvalues will all be real. Not modified. πΈRSIGNβRSIGNisCHARACTER*1. IfMODEis not0,6, or-6, andRSIGN='T', then the elements ofD, as computed according toMODEandCOND, will be multiplied by a random sign (+1or-1). IfRSIGN='F', they will not be.RSIGNmay only have the values'T'or'F'. Not modified. β¨UPPERβUPPERisCHARACTER*1. IfUPPER='T', then the elements ofAabove the diagonal (and above the2x2diagonal blocks, ifAhas complex eigenvalues) will be set to random numbers out ofDIST. IfUPPER='F', they will not.UPPERmay only have the values'T'or'F'. Not modified.SIMβSIMisCHARACTER*1. IfSIM='T', thenAwill be operated on by a , i.e., multiplied on the left by a matrixXand on the right byXinverse.X = U S V, whereUandVare random unitary matrices andSis a (diagonal) matrix of singular values specified byDS,MODES, andCONDS. IfSIM='F', thenAwill not be transformed. Not modified. π«DSβDSisREAL array, dimension ( N ). This array is used to specify the singular values ofX, in the same way thatDspecifies the eigenvalues ofA. IfMODE=0, theDScontains the singular values, which may not be zero. Modified ifMODEis nonzero.MODESβMODESisINTEGER.CONDSβCONDSisREAL. Same asMODEandCOND, but for specifying the diagonal ofS.MODES=-6and+6are not allowed (since they would result in randomly ill-conditioned eigenvalues.) πKLβKLisINTEGER. This specifies the lower bandwidth of the matrix.KL=1specifies upper Hessenberg form. IfKLis at leastN-1, thenAwill have full lower bandwidth.KLmust be at least1. Not modified.KUβKUisINTEGER. This specifies the upper bandwidth of the matrix.KU=1specifies lower Hessenberg form. IfKUis at leastN-1, thenAwill have full upper bandwidth; ifKUandKLare both at leastN-1, thenAwill be dense. Only one ofKUandKLmay be less thanN-1.KUmust be at least1. Not modified. π₯ANORMβANORMisREAL. IfANORMis not negative, thenAwill be scaled by a non-negative real number to make the maximum-element-norm ofAto beANORM. Not modified.AβAisREAL array, dimension ( LDA, N ). On exitAis the desired test matrix. Modified. πLDAβLDAisINTEGER.LDAspecifies the first dimension ofAas declared in the calling program.LDAmust be at leastN. Not modified.WORKβWORKisREAL array, dimension ( 3*N ). Workspace. Modified. π
π« INFO π«
INFOβINTEGER, bestie, this is your error code and it is the most important output here, no cap. On exit,INFOgets set to one of these:0=> normal return π (slay, nothing went wrong)-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
ok so yes, the list literally hops over a few numbers (-3,-4,-7,-17,-18are justβ¦ not invited to the party π). That's not me skipping lines, that's the actual page, iykyk. Every value that is listed is above, character for character, so copy-paste away.
Negative INFO means you fed it something cursed β a bad string, a flag that isn't 'T' or 'F', a count that's too small. Positive INFO means something upstream in the generator chain (SLATM1, SLARGE) gave up, or the scaling ran into a 0 max eigenvalue / a zero singular value. Either way: check INFO or you will be debugging vibes for hours π.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 327 of file slatme.f.
π Author (the meta one)
Generated automatically by Doxygen for LAPACK from the source code.
And that's the whole page, bestie β you made it to the end π«Άπ This little artifact is LAPACK Version 3.12.0, pulled straight from the source code and rendered for TESTING/MATGEN/slatme.f(3) by our good friend Doxygen. Go forth, pass good INFO values, and remember: 0 is the only number that's actually giving β¨ periodt ππ
π¦ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms