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 equations A * X = B for GE matrices (simple driver). πŸ’–
  • DGESV β€” computes the solution to system of linear equations A * X = B for GE matrices. ⭐
  • SGESV β€” computes the solution to system of linear equations A * X = B for GE matrices (simple driver). 🌸
  • ZGESV β€” computes the solution to system of linear equations A * X = B for 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 matrix A. 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 matrix B. Also has to play nice: NRHS >= 0. ✨
  • A β€” A is COMPLEX array, dimension (LDA,N). On entry, the N-by-N coefficient matrix A. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. So she gets replaced β€” like a full rebrand, no cap. πŸ’…
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. 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 matrix P; row i of the matrix was interchanged with row IPIV(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 matrix B. On exit, if INFO = 0, the N-by-NRHS solution matrix X. She came in as a question and left as the answer πŸ˜­πŸ’–
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. Gotta be LDB >= max(1,N). Same energy as LDA, just the other girlie. 🌸
  • INFO β€” INFO is INTEGER, and she's the vibe check at the end of the night:
    • = 0: successful exit πŸŽ‰
    • < 0: if INFO = -i, the i-th argument had an illegal value πŸ’€
    • > 0: if INFO = i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is 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 matrix A. Only N >= 0 allowed, thank you very much. πŸŽ€
  • NRHS β€” NRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrix B. Also NRHS >= 0. πŸ¦‹
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,N). On entry, the N-by-N coefficient matrix A. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. RIP original A, she's been repurposed πŸ’€βœ¨
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N) β€” read it and weep. 🚧
  • IPIV β€” IPIV is INTEGER array, dimension (N). The pivot indices that define the permutation matrix P; row i of the matrix was interchanged with row IPIV(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 matrix B. On exit, if INFO = 0, the N-by-NRHS solution matrix X. Glow up of the century 🫢
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. Gotta satisfy LDB >= max(1,N). Main character constraint energy πŸ‘‘
  • INFO β€” INFO is INTEGER, the final report card:
    • = 0: successful exit, we ate πŸ”₯
    • < 0: if INFO = -i, the i-th argument had an illegal value 😭
    • > 0: if INFO = i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is 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