gesv(3)
β¨ NAME β¨
okay bestie, meet gesv β the page literally says gesv - gesv: factor and solve. That's the whole name vibe: factor and solve, no cap. This is the gesv(3) entry from the Library Functions Manual, and she's here to be your linear-equation bestie. π
π SYNOPSIS π
π§ Functions/Subroutines π§
subroutine cgesv (n, nrhs, a, lda, ipiv, b, ldb, info)
subroutine dgesv (n, nrhs, a, lda, ipiv, b, ldb, info)
subroutine sgesv (n, nrhs, a, lda, ipiv, b, ldb, info)
subroutine zgesv (n, nrhs, a, lda, ipiv, b, ldb, info)
π«Ά Detailed Description π«Ά
CGESVβ computes the solution to system of linear equationsA * X = Bfor GE matrices (simple driver). πDGESVβ computes the solution to system of linear equationsA * X = Bfor GE matrices. βSGESVβ computes the solution to system of linear equationsA * X = Bfor GE matrices (simple driver). πΈZGESVβ computes the solution to system of linear equationsA * X = Bfor GE matrices (simple driver). π
π₯ Function/Subroutine Documentation
Okay bestie, this is the part where we meet the actual cast π β four iconique subroutines, all doing the exact same GLOW-UP job but for different data types. Same plot, different wardrobe. Let's get into it β¨
π subroutine cgesv β the complex single-precision one
subroutine cgesv (integer n, integer nrhs, complex, dimension( lda, * ) a,
integer lda, integer, dimension( * ) ipiv, complex, dimension( ldb, * )
b, integer ldb, integer info)
π Purpose
Not me about to explain this so you actually get it: CGESV computes the solution to a complex system of linear equations
A * X = B,
where A is an N-by-N matrix and X and B are N-by-NRHS matrices. Periodt. π«Ά
The LU decomposition with partial pivoting and row interchanges is used to factor A as
A = P * L * U,
where P is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then used to solve the system of equations A * X = B. It's giving decompose first, solve later, and honestly? Iconic. π
π¦ Parameters
NβN is INTEGER. The number of linear equations, i.e., the order of the matrixA. Constraint era:N >= 0. No negatives, bestie, we don't do that here. πNRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrixB. Also has to play nice:NRHS >= 0. β¨AβA is COMPLEX array, dimension (LDA,N). On entry, the N-by-N coefficient matrixA. On exit, the factorsLandUfrom the factorizationA = P*L*U; the unit diagonal elements ofLare not stored. So she gets replaced β like a full rebrand, no cap. πLDAβLDA is INTEGER. The leading dimension of the arrayA. The rule:LDA >= max(1,N). Respect the boundary fr fr. π§IPIVβIPIV is INTEGER array, dimension (N). The pivot indices that define the permutation matrixP; row i of the matrix was interchanged with rowIPIV(i). That's the receipts of who swapped with who π΅οΈββοΈBβB is COMPLEX array, dimension (LDB,NRHS). On entry, the N-by-NRHS matrix of right hand side matrixB. On exit, ifINFO = 0, the N-by-NRHS solution matrixX. She came in as a question and left as the answer ππLDBβLDB is INTEGER. The leading dimension of the arrayB. Gotta beLDB >= max(1,N). Same energy asLDA, just the other girlie. πΈINFOβINFO is INTEGER, and she's the vibe check at the end of the night:= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i,U(i,i)is exactly zero. The factorization has been completed, but the factorUis exactly singular, so the solution could not be computed. Not a drill β no solution exists, so don't go looking for one. π ββοΈ
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 123 of file cgesv.f.
π subroutine dgesv β the double precision one (real ones only)
subroutine dgesv (integer n, integer nrhs, double precision, dimension( lda,
* ) a, integer lda, integer, dimension( * ) ipiv, double precision,
dimension( ldb, * ) b, integer ldb, integer info)
β Purpose
DGESV computes the solution to a real system of linear equations
A * X = B,
where A is an N-by-N matrix and X and B are N-by-NRHS matrices. Same storyline, double the precision, double the slay π«
The LU decomposition with partial pivoting and row interchanges is used to factor A as
A = P * L * U,
where P is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then used to solve the system of equations A * X = B. We stan a reproducible algorithm π§
π Parameters
NβN is INTEGER. The number of linear equations, i.e., the order of the matrixA. OnlyN >= 0allowed, thank you very much. πNRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrixB. AlsoNRHS >= 0. π¦AβA is DOUBLE PRECISION array, dimension (LDA,N). On entry, the N-by-N coefficient matrixA. On exit, the factorsLandUfrom the factorizationA = P*L*U; the unit diagonal elements ofLare not stored. RIP originalA, she's been repurposed πβ¨LDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N)β read it and weep. π§IPIVβIPIV is INTEGER array, dimension (N). The pivot indices that define the permutation matrixP; row i of the matrix was interchanged with rowIPIV(i). The swap log, basically πΈBβB is DOUBLE PRECISION array, dimension (LDB,NRHS). On entry, the N-by-NRHS matrix of right hand side matrixB. On exit, ifINFO = 0, the N-by-NRHS solution matrixX. Glow up of the century π«ΆLDBβLDB is INTEGER. The leading dimension of the arrayB. Gotta satisfyLDB >= max(1,N). Main character constraint energy πINFOβINFO is INTEGER, the final report card:= 0: successful exit, we ate π₯< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i,U(i,i)is exactly zero. The factorization has been completed, but the factorUis exactly singular, so the solution could not be computed. Truly the worst-case scenario, no cap. π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 123 of file dgesv.f.
π AUTHOR π
Ok bestie, gather round, because this is the funniest part of the whole page:
- Generated automatically by Doxygen for LAPACK from the source code.
That's it. That's the author. Not a human, not a person with a name and a coffee habit and a favorite keyboard β just Doxygen, the documentation generator, doing its little automated thing, pulling straight from the LAPACK source code. No cap. The docs literally wrote themselves. Main character energy from an automated tool, honestly π β¨
So if you ever find a typo in here, likeβ¦ don't @ a person, because there is no person. It's the machine, babes. π«Ά
And that's a wrap on gesv(3)! π You made it all the way to the end β iconic behavior, genuinely. This whole thing came to you from LAPACK, Version 3.12.0, generated automatically by Doxygen straight from the source code, and it's all yours to read whenever you need to solve A * X = B and look cute doing it. ππ¦ Go forth and gesv, bestie β you've got this fr fr πβ¨
π¦ 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