SRC/cspsv.f(3)
π SRC/cspsv.f β like, the LAPACK manual page, but make it make sense
okay so this is cspsv.f, straight out of the Library Functions Manual, and bestieβ¦ it's a Fortran subroutine page. don't scroll away yet, i promise it's actually iconic once you know what it does π«Ά
β¨ NAME β¨
SRC/cspsv.f β that's the whole name section, no cap, the manpage really just says that π
πΈ SYNOPSIS πΈ
Functions/Subroutines
subroutine cspsv (uplo, n, nrhs, ap, ipiv, b, ldb, info)
CSPSV computes the solution to system of linear equations A * X = B for OTHER matrices β yes that's the literal tagline, "OTHER matrices," we love a mysterious queen π
π¦ Function/Subroutine Documentation π¦
subroutine cspsv (character uplo, integer n, integer nrhs, complex,
dimension( * ) ap, integer, dimension( * ) ipiv, complex, dimension(
ldb, * ) b, integer ldb, integer info)
so, what's the vibe? CSPSV computes the solution to system of linear equations A * X = B for OTHER matrices β¨
π Purpose π
!>
!> CSPSV computes the solution to a complex system of linear equations
!> A * X = B,
!> where A is an N-by-N symmetric matrix stored in packed format and X
!> and B are N-by-NRHS matrices.
!>
!> The diagonal pivoting method is used to factor A as
!> A = U * D * U**T, if UPLO = 'U', or
!> A = L * D * L**T, if UPLO = 'L',
!> where U (or L) is a product of permutation and unit upper (lower)
!> triangular matrices, D is symmetric and block diagonal with 1-by-1
!> and 2-by-2 diagonal blocks. The factored form of A is then used to
!> solve the system of equations A * X = B.
!>
so basically: A is N-by-N, symmetric, and stored packed (more on that chaos below π« ), X and B are N-by-NRHS. the diagonal pivoting method factors A into A = U * D * U**T when UPLO = 'U', or A = L * D * L**T when UPLO = 'L'. U (or L) is a product of permutation and unit upper (lower) triangular matrices, D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks. then the factored form of A gets used to solve A * X = B. slay, that's the whole pipeline π
π Parameters π
UPLOβCHARACTER*1. which triangle ofAare we storing, bestie?= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβINTEGER. the number of linear equations, i.e., the order of the matrixA. constraint:N >= 0. β¨NRHSβINTEGER. the number of right hand sides, i.e., the number of columns of the matrixB. constraint:NRHS >= 0.APβCOMPLEXarray, dimension(N*(N+1)/2).- On entry: the upper or lower triangle of the symmetric matrix
A, packed columnwise in a linear array. the j-th column ofAis stored inAPlike this:- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2n-j)/2) = A(i,j)forj<=i<=n.
- if
- see below for further details π
- On exit: the block diagonal matrix
Dand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed byCSPTRF, stored as a packed triangular matrix in the same storage format asA.
- On entry: the upper or lower triangle of the symmetric matrix
IPIVβINTEGERarray, dimension(N). details of the interchanges and the block structure ofD, as determined byCSPTRF. so here's the tea β:- if
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged, andD(k,k)is a 1-by-1 diagonal block. - if
UPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. - if
UPLO = 'L'andIPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- if
BβCOMPLEXarray, dimension(LDB,NRHS). On entry: the N-by-NRHS right hand side matrixB. On exit: ifINFO = 0, the N-by-NRHS solution matrixX. πLDBβINTEGER. the leading dimension of the arrayB. constraint:LDB >= max(1,N). no shortcuts here, she means it.INFOβINTEGER. the receipts:= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i,D(i,i)is exactly zero. the factorization has been completed, but the block diagonal matrixDis exactly singular, so the solution could not be computed. so close and yet so far π
fr fr, watch thatINFO > 0case. singularDmeans no solution for you, bestie.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole squad showed up π«Ά
π§ Further Details: π§
!>
!> The packed storage scheme is illustrated by the following example
!> when N = 4, UPLO = 'U':
!>
!> Two-dimensional storage of the symmetric matrix A:
!>
!> a11 a12 a13 a14
!> a22 a23 a24
!> a33 a34 (aij = aji)
!> a44
!>
!> Packed storage of the upper triangle of A:
!>
!> AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]
!>
see how it's giving "squished but still symmetric"? (aij = aji), so we only keep one half. lowkey elegant πΈ
Definition at line 161 of file cspsv.f.
β Author β
Generated automatically by Doxygen for LAPACK from the source code. (yes, a robot wrote this, we're just vibing on top of it π€β¨)
and that's the whole page, bestie! π this was SRC/cspsv.f from LAPACK Version 3.12.0 β go forth and solve your symmetric packed complex systems, main character style ππ
π¦ 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