posv_mixed(3)
β¨ posv_mixed β¨
okay so bestie, this is posv_mixed(3) from the Library Functions Manual and it's literally the glow-up era of posv β factor and solve, but with mixed precision energy π
no cap, it's giving "why do double the work when single precision ate the first time?"
π¦ NAME π¦
posv_mixed β posv: factor and solve, mixed precision. that's the whole vibe. factor it, solve it, mix the precision, periodt π
πΈ SYNOPSIS πΈ
β¨ Functions β¨
subroutine dsposvβ DSPOSV computes the solution to system of linear equationsA * X = Bfor PO matricessubroutine zcposvβ ZCPOSV computes the solution to system of linear equationsA * X = Bfor PO matrices
and here's the actual signatures, character for character, because I would never mess with your arguments π«Ά
subroutine dsposv (uplo, n, nrhs, a, lda, b, ldb, x, ldx, work, swork,
iter, info)
subroutine zcposv (uplo, n, nrhs, a, lda, b, ldb, x, ldx, work, swork,
rwork, iter, info)
π Detailed Description π
so likeβ¦ the detailed description section is lowkey just vibes and heading energy here β the real tea all lives down in Function Documentation, where each subroutine spills its whole Purpose and every single Parameter. keep scrolling bestie, it's all there π
π Function Documentation π
β subroutine dsposv β
subroutine dsposv (character uplo, integer n, integer nrhs, double
precision, dimension( lda, * ) a, integer lda, double precision,
dimension( ldb, * ) b, integer ldb, double precision, dimension( ldx, *
) x, integer ldx, double precision, dimension( n, * ) work, real,
dimension( * ) swork, integer iter, integer info)
DSPOSV computes the solution to system of linear equations A * X = B for PO matrices. iconic. π¦
Purpose π
DSPOSV computes the solution to a real system of linear equations
A * X = B,
where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.
DSPOSV first attempts to factorize the matrix in SINGLE PRECISION and use this factorization within an iterative refinement procedure to produce a solution with DOUBLE PRECISION normwise backward error quality (see below, bestie). If the approach fails, the method switches to a DOUBLE PRECISION factorization and solve.
the iterative refinement is not going to be a winning strategy if the ratio of SINGLE PRECISION performance over DOUBLE PRECISION performance is too small. a reasonable strategy should take the number of right-hand sides and the size of the matrix into account. this might be done with a call to ILAENV in the future. up to now, we always try iterative refinement β always, no questions, no vibe check π
The iterative refinement process is stopped if
ITER > ITERMAX
or for all the RHS we have:
RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX
where
ITERis the number of the current iteration in the iterative refinement processRNRMis the infinity-norm of the residualXNRMis the infinity-norm of the solutionANRMis the infinity-operator-norm of the matrixAEPSis the machine epsilon returned byDLAMCH('Epsilon')
The value ITERMAX and BWDMAX are fixed to 30 and 1.0D+00 respectively. locked in, fr fr π
Parameters πΈ
UPLOβUPLOisCHARACTER*1= 'U': upper triangle ofAis stored;= 'L': lower triangle ofAis stored.
NβNisINTEGER. the number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSβNRHSisINTEGER. the number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.AβAisDOUBLE PRECISIONarray, dimension(LDA,N). On entry, the symmetric matrixA. IfUPLO = 'U', the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. On exit, if iterative refinement has been successfully used (INFO = 0andITER >= 0, see description below), thenAis unchanged, if double precision factorization has been used (INFO = 0andITER < 0, see description below), then the arrayAcontains the factorUorLfrom the Cholesky factorizationA = U**T*UorA = L*L**T.LDAβLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).BβBisDOUBLE PRECISIONarray, dimension(LDB,NRHS). the N-by-NRHS right hand side matrixB.LDBβLDBisINTEGER. the leading dimension of the arrayB.LDB >= max(1,N).XβXisDOUBLE PRECISIONarray, dimension(LDX,NRHS). ifINFO = 0, the N-by-NRHS solution matrixX. πLDXβLDXisINTEGER. the leading dimension of the arrayX.LDX >= max(1,N).WORKβWORKisDOUBLE PRECISIONarray, dimension(N,NRHS). this array is used to hold the residual vectors.SWORKβSWORKisREALarray, dimension(N*(N+NRHS)). this array is used to use the single precision matrix and the right-hand sides or solutions in single precision.ITERβITERisINTEGER.< 0: iterative refinement has failed, double precision factorization has been performed-1: the routine fell back to full precision for implementation- or machine-specific reasons-2: narrowing the precision induced an overflow, the routine fell back to full precision-3: failure ofSPOTRF-31: stop the iterative refinement after the 30th iterations> 0: iterative refinement has been successfully used. Returns the number of iterations β¨
INFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, the leading principal minor of order i of (DOUBLE PRECISION)Ais not positive, so the factorization could not be completed, and the solution has not been computed. π that one's a whole mood ruiner ngl
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 197 of file dsposv.f.
π subroutine zcposv π
subroutine zcposv (character uplo, integer n, integer nrhs, complex*16,
dimension( lda, * ) a, integer lda, complex*16, dimension( ldb, * ) b,
integer ldb, complex*16, dimension( ldx, * ) x, integer ldx, complex*16,
dimension( n, * ) work, complex, dimension( * ) swork, double precision,
dimension( * ) rwork, integer iter, integer info)
ZCPOSV computes the solution to system of linear equations A * X = B for PO matrices. yes, the complex one. she's that girl π§
Purpose π
ZCPOSV computes the solution to a complex system of linear equations
A * X = B,
where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.
ZCPOSV first attempts to factorize the matrix in COMPLEX and use this factorization within an iterative refinement procedure to produce a solution with COMPLEX*16 normwise backward error quality (see below, bestie). If the approach fails, the method switches to a COMPLEX*16 factorization and solve.
the iterative refinement is not going to be a winning strategy if the ratio of COMPLEX performance over COMPLEX*16 performance is too small. a reasonable strategy should take the number of right-hand sides and the size of the matrix into account. this might be done with a call to ILAENV in the future. up to now, we always try iterative refinement. same energy, different precision, iykyk π«Ά
The iterative refinement process is stopped if
ITER > ITERMAX
or for all the RHS we have:
RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX
where
ITERis the number of the current iteration in the iterative refinement processRNRMis the infinity-norm of the residualXNRMis the infinity-norm of the solutionANRMis the infinity-operator-norm of the matrixAEPSis the machine epsilon returned byDLAMCH('Epsilon')
The value ITERMAX and BWDMAX are fixed to 30 and 1.0D+00 respectively. same constants, same slay π
Parameters πΈ
UPLOβUPLOisCHARACTER*1= 'U': upper triangle ofAis stored;= 'L': lower triangle ofAis stored.
NβNisINTEGER. the number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSβNRHSisINTEGER. the number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.AβAisCOMPLEX*16array, dimension(LDA,N). On entry, the Hermitian matrixA. IfUPLO = 'U', the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
Note that the imaginary parts of the diagonal elements need not be set and are assumed to be zero. π zero. assumed. don't come at her with imaginary diagonals.
On exit, if iterative refinement has been successfully used (INFO = 0 and ITER >= 0, see description below), then A is unchanged, if double precision factorization has been used (INFO = 0 and ITER < 0, see description below), then the array A contains the factor U or L from the Cholesky factorization A = U**H*U or A = L*L**H.
LDAβLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).BβBisCOMPLEX*16array, dimension(LDB,NRHS). the N-by-NRHS right hand side matrixB.LDBβLDBisINTEGERβ¦ and bestie, that's exactly where this part of the page runs out, so hold that thought, the rest is coming in part 2 ππLDBβLDBisINTEGER, and itβs the leading dimension of the arrayB. The rule isLDB >= max(1,N). Respect the leading dimension, bestie πXβXis aCOMPLEX*16array with dimension(LDX,NRHS). IfINFO = 0, this is theN-by-NRHSsolution matrixX. Thatβs the payoff, periodt β¨LDXβLDXisINTEGER. Itβs the leading dimension of the arrayX, andLDX >= max(1,N). Keep it legal or the vibes are off πWORKβWORKis aCOMPLEX*16array with dimension(N,NRHS). This array is used to hold the residual vectors. Residuals are just the drama in math form πSWORKβSWORKis aCOMPLEXarray with dimension(N*(N+NRHS)). This array is used to use the single precision matrix and the right-hand sides or solutions in single precision. Single precision said βlet me helpβ π¦RWORKβRWORKis aDOUBLE PRECISIONarray with dimension(N). Thatβs it, thatβs the whole vibe πΈITERβITERisINTEGER. Hereβs the tea:< 0: iterative refinement has failed, andCOMPLEX*16factorization has been performed.-1: the routine fell back to full precision for implementation- or machine-specific reasons.-2: narrowing the precision induced an overflow, and the routine fell back to full precision.-3: failure ofCPOTRF.-31: stop the iterative refinement after the 30th iterations.
> 0: iterative refinement has been successfully used. Returns the number of iterations. Slay, it converged π₯
INFOβINFOisINTEGER.= 0: successful exit.< 0: ifINFO = -i, thei-th argument had an illegal value.> 0: ifINFO = i, the leading principal minor of orderiof (COMPLEX*16)Ais not positive, so the factorization could not be completed, and the solution has not been computed. Thatβs a no-solution situation, no cap π
π«Ά Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 207 of file zcposv.f.
πͺ Author
Generated automatically by Doxygen for LAPACK from the source code.
This page came from LAPACK Version 3.12.0 and itβs the posv_mixed(3) manual page β go forth and refine iteratively, bestie πβ¨
π¦ 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