ptsvx(3)
β¨ ptsvx(3) β¨ β Library Functions Manual
okay so bestie, we're in ptsvx(3) territory and this is the expert flavour of the PT-matrix saga β factor and solve, with receipts (error bounds, condition estimates, the whole vibe). This page is a chunky one so buckle up π
πΈ NAME πΈ
ptsvx β ptsvx: factor and solve, expert
literally that's the whole name, she's efficient π
π SYNOPSIS π
β¨ Functions β¨
Here's the whole friend group β four subroutines, one for each flavour of precision and vibes:
subroutine cptsvx (fact, n, nrhs, d, e, df, ef, b, ldb, x, ldx, rcond,
ferr, berr, work, rwork, info)
CPTSVX computes the solution to system of linear equations A * X = B for PT matrices π¦
subroutine dptsvx (fact, n, nrhs, d, e, df, ef, b, ldb, x, ldx, rcond,
ferr, berr, work, info)
DPTSVX computes the solution to system of linear equations A * X = B for PT matrices πΈ
subroutine sptsvx (fact, n, nrhs, d, e, df, ef, b, ldb, x, ldx, rcond,
ferr, berr, work, info)
SPTSVX computes the solution to system of linear equations A * X = B for PT matrices β
subroutine zptsvx (fact, n, nrhs, d, e, df, ef, b, ldb, x, ldx, rcond,
ferr, berr, work, rwork, info)
ZPTSVX computes the solution to system of linear equations A * X = B for PT matrices π
π Detailed Description π
(we love a section that's just a heading, she said "the details are in the functions, go look" π)
π¦ Function Documentation π¦
π subroutine cptsvx
subroutine cptsvx (character fact, integer n, integer nrhs, real, dimension(
* ) d, complex, dimension( * ) e, real, dimension( * ) df, complex,
dimension( * ) ef, complex, dimension( ldb, * ) b, integer ldb, complex,
dimension( ldx, * ) x, integer ldx, real rcond, real, dimension( * )
ferr, real, dimension( * ) berr, complex, dimension( * ) work, real,
dimension( * ) rwork, integer info)
CPTSVX computes the solution to system of linear equations A * X = B for PT matrices π
π Purpose
no cap, here's what she does:
CPTSVX uses the factorizationA = L*D*L**Hto compute the solution to a complex system of linear equationsA*X = B, where A is an N-by-N Hermitian positive definite tridiagonal matrix and X and B are N-by-NRHS matrices.
Error bounds on the solution and a condition estimate are also provided.
like she solves it and tells you how much you should trust the answer. main character energy honestly π
π₯ Description
the steps, in order, periodt:
The following steps are performed:
- If
FACT = 'N', the matrix A is factored asA = L*D*L**H, where L is a unit lower bidiagonal matrix and D is diagonal. The factorization can also be regarded as having the formA = U**H*D*U. - If the leading principal minor of order i is not positive, then the routine returns with
INFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision,INFO = N+1is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below. - The system of equations is solved for X using the factored form of A.
- Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
okay so step 2 is the girl who says "this might be messy but I'm finishing the job anyway" and honestly? respect π«Ά
π Parameters
FACTβFACT is CHARACTER*1. Specifies whether or not the factored form of the matrix A is supplied on entry.= 'F': On entry,DFandEFcontain the factored form of A.D,E,DF, andEFwill not be modified.= 'N': The matrix A will be copied toDFandEFand factored.
NβN is INTEGER. The order of the matrix A.N >= 0.NRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X.NRHS >= 0.DβD is REAL array, dimension (N). The n diagonal elements of the tridiagonal matrix A.EβE is COMPLEX array, dimension (N-1). The (n-1) subdiagonal elements of the tridiagonal matrix A.DFβDF is REAL array, dimension (N). IfFACT = 'F', thenDFis an input argument and on entry contains the n diagonal elements of the diagonal matrix D from theL*D*L**Hfactorization of A. IfFACT = 'N', thenDFis an output argument and on exit contains the n diagonal elements of the diagonal matrix D from theL*D*L**Hfactorization of A.EFβEF is COMPLEX array, dimension (N-1). IfFACT = 'F', thenEFis an input argument and on entry contains the (n-1) subdiagonal elements of the unit bidiagonal factor L from theL*D*L**Hfactorization of A. IfFACT = 'N', thenEFis an output argument and on exit contains the (n-1) subdiagonal elements of the unit bidiagonal factor L from theL*D*L**Hfactorization of A.BβB is COMPLEX array, dimension (LDB,NRHS). The N-by-NRHS right hand side matrix B.LDBβLDB is INTEGER. The leading dimension of the array B.LDB >= max(1,N).XβX is COMPLEX array, dimension (LDX,NRHS). IfINFO = 0orINFO = N+1, the N-by-NRHS solution matrix X.LDXβLDX is INTEGER. The leading dimension of the array X.LDX >= max(1,N).RCONDβRCOND is REAL. The reciprocal condition number of the matrix A. IfRCONDis less than the machine precision (in particular, ifRCOND = 0), the matrix is singular to working precision. This condition is indicated by a return code ofINFO > 0.FERRβFERR is REAL array, dimension (NRHS). The forward error bound for each solution vectorX(j)(the j-th column of the solution matrix X). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j).BERRβBERR is REAL array, dimension (NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element of A or B that makesX(j)an exact solution).WORKβWORK is COMPLEX array, dimension (N).RWORKβRWORK is REAL array, dimension (N).INFOβINFO is INTEGER.= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, and i is<= N: the leading principal minor of order i of A is not positive, so the factorization could not be completed, and the solution has not been computed.RCOND = 0is returned.= N+1: U is nonsingular, butRCONDis less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value ofRCONDwould suggest.
ngl the INFO = N+1 case is iconic β she's basically like "the vibes say singular but the math says try me" π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 232 of file cptsvx.f.
πΈ subroutine dptsvx
subroutine dptsvx (character fact, integer n, integer nrhs, double
precision, dimension( * ) d, double precision, dimension( * ) e, double
precision, dimension( * ) df, double precision, dimension( * ) ef,
double precision, dimension( ldb, * ) b, integer ldb, double precision,
dimension( ldx, * ) x, integer ldx, double precision rcond, double
precision, dimension( * ) ferr, double precision, dimension( * ) berr,
double precision, dimension( * ) work, integer info)
DPTSVX computes the solution to system of linear equations A * X = B for PT matrices π§
π Purpose
DPTSVX uses the factorizationA = L*D*L**Tto compute the solution to a real system of linear equationsA*X = B, where A is an N-by-N symmetric positive definite tridiagonal matrix and X and B are N-by-NRHS matrices.
Error bounds on the solution and a condition estimate are also provided.
note bestie: this one's the real twin β L*D*L**T and symmetric, not L**H and Hermitian. the transposes are lowercase-T here, fr fr π«
π₯ Description
The following steps are performed:
- If
FACT = 'N', the matrix A is factored asA = L*D*L**T, where L is a unit lower bidiagonal matrix and D is diagonal. The factorization can also be regarded as having the formA = U**T*D*U. - If the leading principal minor of order i is not positive, then the routine returns with
INFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision,INFO = N+1is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below. - The system of equations is solved for X using the factored form of A.
- Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
same four-step choreo, different precision aesthetic β¨
π Parameters
FACTβFACT is CHARACTER*1. Specifies whether or not the factored form of A has been supplied on entry.= 'F': On entry,DFandEFcontain the factored form of A.D,E,DF, andEFwill not be modified.= 'N': The matrix A will be copied toDFandEFand factored.
NβN is INTEGER. The order of the matrix A.N >= 0.NRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X.NRHS >= 0.DβDOUBLE PRECISIONarray, dimension(N). Thendiagonal elements of the tridiagonal matrixA. that's her πEβDOUBLE PRECISIONarray, dimension(N-1). The(n-1)subdiagonal elements of the tridiagonal matrixA. yes it's one shorter thanD, no that's not a typo, that's just how bidiagonal-ish things roll πDFβDOUBLE PRECISIONarray, dimension(N). okay so it's giving "depends onFACT":- if
FACT = 'F',DFis an input argument, and on entry it contains thendiagonal elements of the diagonal matrixDfrom theL*D*L**Tfactorization ofA. - if
FACT = 'N',DFis an output argument, and on exit it contains thendiagonal elements of the diagonal matrixDfrom theL*D*L**Tfactorization ofA.
- if
EFβDOUBLE PRECISIONarray, dimension(N-1). same energy, different slot:- if
FACT = 'F',EFis an input argument and on entry it contains the(n-1)subdiagonal elements of the unit bidiagonal factorLfrom theL*D*L**Tfactorization ofA. - if
FACT = 'N',EFis an output argument and on exit it contains the(n-1)subdiagonal elements of the unit bidiagonal factorLfrom theL*D*L**Tfactorization ofA.
- if
BβDOUBLE PRECISIONarray, dimension(LDB,NRHS). TheN-by-NRHSright hand side matrixB. the whole reason we're here fr fr π«ΆLDBβINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). respect the constraint bestie, she will notice πXβDOUBLE PRECISIONarray, dimension(LDX,NRHS). IfINFO = 0ofINFO = N+1, theN-by-NRHSsolution matrixX. (thatofis a typo in the original, it means or π the math is fine, the grammar is not)LDXβINTEGER. The leading dimension of the arrayX.LDX >= max(1,N). same deal asLDB,max(1,N)and all β¨RCONDβDOUBLE PRECISION. The reciprocal condition number of the matrixA. IfRCONDis less than the machine precision (in particular, ifRCOND = 0), the matrix is singular to working precision. This condition is indicated by a return code ofINFO > 0. so likeβ¦ she's telling you how sketchy your matrix is πFERRβDOUBLE PRECISIONarray, dimension(NRHS). The forward error bound for each solution vectorX(j)(thej-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). literally "how far off are you, relatively speaking" πBERRβDOUBLE PRECISIONarray, dimension(NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution). iconic little "how much would I have to lie to you to be right" metric π¦WORKβDOUBLE PRECISIONarray, dimension(2*N). scratch space, don't touch, don't question her πΈINFOβINTEGER. the receipts:= 0: successful exit π< 0: ifINFO = -i, thei-th argument had an illegal value β you passed something cursed, go fix it π> 0: ifINFO = i, andiis<= N: the leading principal minor of orderiofAis not positive, so the factorization could not be completed, and the solution has not been computed.RCOND = 0is returned. translation: she stopped mid-way, no answer for you, and she's telling you exactly where it went wrong π= N+1:Uis nonsingular, butRCONDis less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value ofRCONDwould suggest. this is the "warning but keep going" one, she's a lil scuffed but she pulled through πβ¨
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
shoutout to the entire academic-industrial complex, they ate ππ«Ά
β Definition at line 226 of file dptsvx.f.
like, line 226 of dptsvx.f, go look, she's there π
π¦ and nowβ¦ the REAL one (yes there's a single-precision twin)
subroutine sptsvx (character fact, integer n, integer nrhs, real, dimension(
* ) d, real, dimension( * ) e, real, dimension( * ) df, real, dimension(
* ) ef, real, dimension( ldb, * ) b, integer ldb, real, dimension( ldx,
* ) x, integer ldx, real rcond, real, dimension( * ) ferr, real,
dimension( * ) berr, real, dimension( * ) work, integer info)
SPTSVX computes the solution to system of linear equations A * X = B for PT matrices β¨
so literally the same routine as DPTSVX but everything's REAL instead of DOUBLE PRECISION. same vibes, less precision, arguably more chill π
πΈ Purpose:
SPTSVX uses the factorization A = L*D*L**T to compute the solution to a real system of linear equations A*X = B, where A is an N-by-N symmetric positive definite tridiagonal matrix and X and B are N-by-NRHS matrices.
Error bounds on the solution and a condition estimate are also provided. so not only does she solve it, she also tells you how much to trust the answer. main character behaviour π π
π Description:
here's the whole plot, step by step:
- If
FACT = 'N', the matrixAis factored asA = L*D*L**T, whereLis a unit lower bidiagonal matrix andDis diagonal. The factorization can also be regarded as having the formA = U**T*D*U. two ways to look at the same glow-up π¦ - If the leading principal minor of order
iis not positive, then the routine returns withINFO = i. Otherwise, the factored form ofAis used to estimate the condition number of the matrixA. If the reciprocal of the condition number is less than machine precision,INFO = N+1is returned as a warning, but the routine still goes on to solve forXand compute error bounds as described below. she's not gonna abandon you over a warning, she's built different π - The system of equations is solved for
Xusing the factored form ofA. - Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it. glow-up round two, now with receipts β¨
π§ Parameters
FACTβCHARACTER*1. Specifies whether or not the factored form ofAhas been supplied on entry.= 'F': On entry,DFandEFcontain the factored form ofA.D,E,DF, andEFwill not be modified. she respects your inputs, no cap π«Ά= 'N': The matrixAwill be copied toDFandEFand factored. she'll do it herself, it's fine π
NβINTEGER. The order of the matrixA.N >= 0.NRHSβINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0. yes you can feed her multiple right hand sides at once, she's efficient like that πΈDβREALarray, dimension(N). Thendiagonal elements of the tridiagonal matrixA. πEβREALarray, dimension(N-1). The(n-1)subdiagonal elements of the tridiagonal matrixA.DFβREALarray, dimension(N). again,FACT-dependent:- if
FACT = 'F', thenDFis an input argument and on entry contains thendiagonal elements of the diagonal matrixDfrom theL*D*L**Tfactorization ofA. - if
FACT = 'N', thenDFis an output argument and on exit contains thendiagonal elements of the diagonal matrixDfrom theL*D*L**Tfactorization ofA.
- if
EFβREALarray, dimension(N-1). same pattern bestie:- if
FACT = 'F', thenEFis an input argument and on entry contains the(n-1)subdiagonal elements of the unit bidiagonal factorLfrom theL*D*L**Tfactorization ofA. - if
FACT = 'N', thenEFis an output argument and on exit contains the(n-1)subdiagonal elements of the unit bidiagonal factorLfrom theL*D*L**Tfactorization ofA.
- if
BβREALarray, dimension(LDB,NRHS). TheN-by-NRHSright hand side matrixB. πLDBβINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβREALarray, dimension(LDX,NRHS). IfINFO = 0ofINFO = N+1, theN-by-NRHSsolution matrixX. (again with theof, again meaning or, again not my fault π)LDXβINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDβREAL. The reciprocal condition number of the matrixA. IfRCONDis less than the machine precision (in particular, ifRCOND = 0), the matrix is singular to working precision. This condition is indicated by a return code ofINFO > 0. your vibe check on the matrix, basically πFERRβREALarray, dimension(NRHS). The forward error bound for each solution vectorX(j)(thej-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j).BERRβREALarray, dimension(NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).WORKβREALarray, dimension(2*N). scratch space, she needs room to think πΈINFOβINTEGER. bestie this one has lore, hold on π
Still on sptsvx: INFO is INTEGER, and it's the final vibe report of the call:
= 0: successful exit β slay, we're done. β< 0: ifINFO = -i, the i-th argument had an illegal value β so something you passed was lowkey not it. π> 0: ifINFO = i, and i is:<= N: the leading principal minor of order i ofAis not positive, so the factorization could not be completed, and the solution has not been computed.RCOND = 0is returned. π= N+1:Uis nonsingular, butRCONDis less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value ofRCONDwould suggest. π
π«Ά Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 226 of file sptsvx.f.
π subroutine zptsvx
subroutine zptsvx (character fact, integer n, integer nrhs, double
precision, dimension( * ) d, complex*16, dimension( * ) e, double
precision, dimension( * ) df, complex*16, dimension( * ) ef, complex*16,
dimension( ldb, * ) b, integer ldb, complex*16, dimension( ldx, * ) x,
integer ldx, double precision rcond, double precision, dimension( * )
ferr, double precision, dimension( * ) berr, complex*16, dimension( * )
work, double precision, dimension( * ) rwork, integer info)
ZPTSVX computes the solution to system of linear equations A * X = B for PT matrices β literally what it says on the tin, and it's giving main character energy. π
π¦ Purpose
ZPTSVX uses the factorization A = L*D*L**H to compute the solution to a complex system of linear equations A*X = B, where A is an N-by-N Hermitian positive definite tridiagonal matrix and X and B are N-by-NRHS matrices.
Error bounds on the solution and a condition estimate are also provided β yes, it's doing the most, and we love that for it. π
πΈ Description
The following steps are performed β yes, all of them, bestie:
- If
FACT = 'N', the matrixAis factored asA = L*D*L**H, whereLis a unit lower bidiagonal matrix andDis diagonal. The factorization can also be regarded as having the formA = U**H*D*U. - If the leading principal minor of order i is not positive, then the routine returns with
INFO = i. Otherwise, the factored form ofAis used to estimate the condition number of the matrixA. If the reciprocal of the condition number is less than machine precision,INFO = N+1is returned as a warning, but the routine still goes on to solve forXand compute error bounds as described below. - The system of equations is solved for
Xusing the factored form ofA. - Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
π Parameters
FACTβFACT is CHARACTER*1. It specifies whether or not the factored form of the matrixAis supplied on entry.= 'F': On entry,DFandEFcontain the factored form ofA.D,E,DF, andEFwill not be modified.= 'N': The matrixAwill be copied toDFandEFand factored.
NβN is INTEGER. The order of the matrixA.N >= 0.NRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.DβD is DOUBLE PRECISION array, dimension (N). Thendiagonal elements of the tridiagonal matrixA.EβE is COMPLEX*16 array, dimension (N-1). The(n-1)subdiagonal elements of the tridiagonal matrixA.DFβDF is DOUBLE PRECISION array, dimension (N). IfFACT = 'F', thenDFis an input argument and on entry contains thendiagonal elements of the diagonal matrixDfrom theL*D*L**Hfactorization ofA. IfFACT = 'N', thenDFis an output argument and on exit contains thendiagonal elements of the diagonal matrixDfrom theL*D*L**Hfactorization ofA.EFβEF is COMPLEX*16 array, dimension (N-1). IfFACT = 'F', thenEFis an input argument and on entry contains the(n-1)subdiagonal elements of the unit bidiagonal factorLfrom theL*D*L**Hfactorization ofA. IfFACT = 'N', thenEFis an output argument and on exit contains the(n-1)subdiagonal elements of the unit bidiagonal factorLfrom theL*D*L**Hfactorization ofA.BβB is COMPLEX*16 array, dimension (LDB,NRHS). TheN-by-NRHSright hand side matrixB.LDBβLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβX is COMPLEX*16 array, dimension (LDX,NRHS). IfINFO = 0orINFO = N+1, theN-by-NRHSsolution matrixX.LDXβLDX is INTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDβRCOND is DOUBLE PRECISION. The reciprocal condition number of the matrixA. IfRCONDis less than the machine precision (in particular, ifRCOND = 0), the matrix is singular to working precision. This condition is indicated by a return code ofINFO > 0.FERRβFERR is DOUBLE PRECISION array, dimension (NRHS). The forward error bound for each solution vectorX(j)(the j-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j).BERRβBERR is DOUBLE PRECISION array, dimension (NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).WORKβWORK is COMPLEX*16 array, dimension (N).RWORKβRWORK is DOUBLE PRECISION array, dimension (N).INFOβINFO is INTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, and i is:<= N: the leading principal minor of order i ofAis not positive, so the factorization could not be completed, and the solution has not been computed.RCOND = 0is returned.= N+1:Uis nonsingular, butRCONDis less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value ofRCONDwould suggest.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 232 of file zptsvx.f.
π Author
Generated automatically by Doxygen for LAPACK from the source code.
Okay that's the whole page, bestie. π«Ά The footer is serving source/version/date energy: LAPACK, Version 3.12.0, and the ptsvx(3) date stamp β iconic, no notes. π
β¨
π¦ 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