SRC/dtrsen.f(3)
πΈ SRC/dtrsen.f(3) β like, the actual manual page, bestie πΈ
Okay so this is from the Library Functions Manual, and the page itself is SRC/dtrsen.f(3) β yes the filename is literally the vibe, it's a Fortran source file (dtrsen.f) and its section-3 manpage, all in one π
β¨ NAME β¨
SRC/dtrsen.f β that's it, that's the name, no cap π
β¨ SYNOPSIS β¨
π¦ Functions/Subroutines π¦
subroutine dtrsen (job, compq, select, n, t, ldt, q, ldq, wr, wi, m, s, sep, work, lwork, iwork, liwork, info)β the whole entire function signature, copied exactly, don't @ me π«Ά
And under it, simply:
DTRSEN
That's the routine's name. Short, iconic, main character energy π
π So what's the deal with this one π
Bestie, look at that argument list. Eighteen arguments. One-eight. job, compq, select, n, t, ldt, q, ldq, wr, wi, m, s, sep, work, lwork, iwork, liwork, info β that's the full roster and not a single one of them is getting cut from the group chat π
This is DTRSEN, and it's a Fortran subroutine (lowercase dtrsen, because Fortran has no chill about case in the docs but also all the chill in the compiler, iykyk). It lives in the file SRC/dtrsen.f, which is exactly what the page title says, so at least nobody's out here lying to us π
Heads up bestie β this is part 1 of 3. The rest of the page is coming, don't wander off π
π₯ DTRSEN π₯
That's the routine name, standing on its own like it owns the place.
Honestly? The way this page just drops DTRSEN and nothing else here, like a celebrity walking past the paparazzi without a word π Keep reading though β more parts are on the way, and we're gonna get into all eighteen of those arguments. Periodt π
part 1 done, stay tuned for part 2 β¨
π Function/Subroutine Documentation π
subroutine dtrsen (character job, character compq, logical, dimension( * )
select, integer n, double precision, dimension( ldt, * ) t, integer ldt,
double precision, dimension( ldq, * ) q, integer ldq, double precision,
dimension( * ) wr, double precision, dimension( * ) wi, integer m,
double precision s, double precision sep, double precision, dimension( *
) work, integer lwork, integer, dimension( * ) iwork, integer liwork,
integer info)
π DTRSEN π
πΈ Purpose πΈ
Okay bestie, so DTRSEN reorders the real Schur factorization of a real matrix A = Q*T*Q**T, so that a selected cluster of eigenvalues shows up in the leading diagonal blocks of the upper quasi-triangular matrix T, and the leading columns of Q form an orthonormal basis of the corresponding right invariant subspace. Iconic, truly.
Optionally β yes, it can do extra credit β the routine computes the reciprocal condition numbers of the cluster of eigenvalues and/or the invariant subspace. Obsessed.
T must be in Schur canonical form (as returned by DHSEQR), that is, block upper triangular with 1-by-1 and 2-by-2 diagonal blocks; each 2-by-2 diagonal block has its diagonal elements equal and its off-diagonal elements of opposite sign. That part is non-negotiable, bestie. π
β¨ Parameters β¨
JOBβJOB is CHARACTER*1. It specifies whether condition numbers are required for the cluster of eigenvalues (S) or the invariant subspace (SEP):= 'N': none;= 'E': for eigenvalues only (S);= 'V': for invariant subspace only (SEP);= 'B': for both eigenvalues and invariant subspace (SandSEP). Slay.COMPQβCOMPQ is CHARACTER*1.= 'V': update the matrixQof Schur vectors;= 'N': do not updateQ. Simple as that. β¨SELECTβSELECT is LOGICAL array, dimension (N). It specifies the eigenvalues in the selected cluster. To select a real eigenvaluew(j),SELECT(j)must be set to.TRUE.. To select a complex conjugate pair of eigenvaluesw(j)andw(j+1), corresponding to a2-by-2diagonal block, eitherSELECT(j)orSELECT(j+1)or both must be set to.TRUE.; a complex conjugate pair of eigenvalues must be either both included in the cluster or both excluded. No halfsies, periodt. πNβN is INTEGER. The order of the matrixT.N >= 0. Respect.TβT is DOUBLE PRECISION array, dimension (LDT,N). On entry, the upper quasi-triangular matrixT, in Schur canonical form. On exit,Tis overwritten by the reordered matrixT, again in Schur canonical form, with the selected eigenvalues in the leading diagonal blocks. Glow-up complete. π¦LDTβLDT is INTEGER. The leading dimension of the arrayT.LDT >= max(1,N). Keep it valid, bestie.QβQ is DOUBLE PRECISION array, dimension (LDQ,N). On entry, ifCOMPQ = 'V', the matrixQof Schur vectors. On exit, ifCOMPQ = 'V',Qhas been postmultiplied by the orthogonal transformation matrix which reordersT; the leadingMcolumns ofQform an orthonormal basis for the specified invariant subspace. IfCOMPQ = 'N',Qis not referenced. Sheβs off the invite list in that case. πLDQβLDQ is INTEGER. The leading dimension of the arrayQ.LDQ >= 1; and ifCOMPQ = 'V',LDQ >= N. πWRβWR is DOUBLE PRECISION array, dimension (N). Real parts. Yes bestie, the real parts are coming in this array.WIβWI is DOUBLE PRECISION array, dimension (N). The real and imaginary parts, respectively, of the reordered eigenvalues ofT. The eigenvalues are stored in the same order as on the diagonal ofT, withWR(i) = T(i,i)and, ifT(i:i+1,i:i+1)is a2-by-2diagonal block,WI(i) > 0andWI(i+1) = -WI(i). Note that if a complex eigenvalue is sufficiently ill-conditioned, then its value may differ significantly from its value before reordering. So likeβ¦ keep an eye on her. πMβM is INTEGER. The dimension of the specified invariant subspace.0 < = M <= N. Math said what it said. πΈSβS is DOUBLE PRECISION. IfJOB = 'E'or'B',Sis a lower bound on the reciprocal condition number for the selected cluster of eigenvalues.Scannot underestimate the true reciprocal condition number by more than a factor ofsqrt(N). IfM = 0orN,S = 1. IfJOB = 'N'or'V',Sis not referenced. Sheβs on standby. β¨SEPβSEP is DOUBLE PRECISION. IfJOB = 'V'or'B',SEPis the estimated reciprocal condition number of the specified invariant subspace. IfM = 0orN,SEP = norm(T). IfJOB = 'N'or'E',SEPis not referenced. Main character only when requested. πWORKβWORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. Sheβs working overtime but making it cute. π«ΆLWORKβLWORK is INTEGER. The dimension of the arrayWORK. IfJOB = 'N',LWORK >= max(1,N); ifJOB = 'E',LWORK >= max(1,M*(N-M)); ifJOB = 'V'or'B',LWORK >= max(1,2*M*(N-M)). IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. Query mode ate, honestly. πIWORKβIWORK is INTEGER array, dimension (MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the optimalLIWORK. Integer bestie has entered the chat. πLIWORKβLIWORK is INTEGER. The dimension of the arrayIWORK. IfJOB = 'N'or'E',LIWORK >= 1; ifJOB = 'V'or'B',LIWORK >= max(1,M*(N-M)). IfLIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theIWORKarray, returns this value as the first entry of theIWORKarray, and no error message related toLIWORKis issued byXERBLA. Same energy, different array. βINFOβINFO is INTEGER.= 0: successful exit;< 0: ifINFO = -i, thei-thargument had an illegal value;= 1: reordering ofTfailed because some eigenvalues are too close to separate (the problem is very ill-conditioned);Tmay have been partially reordered, andWRandWIcontain the eigenvalues in the same order as inT;SandSEP(if requested) are set to zero. When itβs giving= 1, thatβs the dramatic plot twist β not a slay. π
π AUTHOR π
okay so here's the tea: nobody actually hand-wrote this page. it's literally Generated automatically by Doxygen for LAPACK from the source code. β so if you were about to go hunt down a human author to thank, bestie, there isn't one to @ π the doc fairy (aka Doxygen) just vibed off the LAPACK source and cranked this out. no cap, that's the whole origin story π
β¨
aaaand that's a wrap on SRC/dtrsen.f(3), bestie π you made it to the end, which is honestly iconic behavior. this whole glow-up came to you courtesy of LAPACK, Version 3.12.0 β go forth and slay, you absolute main character ππ¦πΈ
π¦ 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