realPTsolve(3)
π realPTsolve(3) β the LAPACK glow-up π
okay bestie, pull up a chair, grab a boba π§, because we're about to get intimately familiar with realPTsolve, aka the real solve driver functions for PT matrices, straight out of the LAPACK manual (manual section 3, if you're keeping track π). This is the group chat of routines that solve A * X = B when A is a real symmetric positive definite tridiagonal matrix. Slay.
β¨ NAME β¨
realPTsolve β real. That's it. That's the name. Short, iconic, no notes. π
π¦ SYNOPSIS π¦
Functions
subroutine sptsv (N, NRHS, D, E, B, LDB, INFO)β SPTSV computes the solution to system of linear equationsA * X = Bfor 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 equationsA * X = Bfor PT matrices π
π Detailed Description π
This is the group of real solve driver functions for PT matrices. They're the main characters of this page, fr fr. π₯
π Function Documentation π
π subroutine sptsv π
subroutine sptsv (integer N, integer NRHS, real, dimension( * ) D, real,
dimension( * ) E, real, dimension( ldb, * ) B, integer LDB, integer
INFO)
SPTSV computes the solution to system of linear equations A * X = B for PT matrices. It's giving solver energy.
Purpose:
SPTSV computes 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.
A is factored as A = L*D*L**T, and the factored form of A is then used to solve the system of equations. Lowkey elegant, highkey efficient. β¨
Parameters
NNis INTEGER- The order of the matrix
A.N >= 0.
NRHSNRHSis INTEGER- The number of right hand sides, i.e., the number of columns of the matrix
B.NRHS >= 0.
DDis REAL array, dimension(N)- On entry, the n diagonal elements of the tridiagonal matrix
A. On exit, the n diagonal elements of the diagonal matrixDfrom the factorizationA = L*D*L**T.
EEis REAL array, dimension(N-1)- On entry, the (n-1) subdiagonal elements of the tridiagonal matrix
A. On exit, the (n-1) subdiagonal elements of the unit bidiagonal factorLfrom theL*D*L**Tfactorization ofA. (Ecan also be regarded as the superdiagonal of the unit bidiagonal factorUfrom theU**T*D*Ufactorization ofA.)
BBis REAL array, dimension(LDB,NRHS)- On entry, the N-by-NRHS right hand side matrix
B. On exit, ifINFO = 0, the N-by-NRHS solution matrixX. glow-up complete π«
LDBLDBis INTEGER- The leading dimension of the array
B.LDB >= max(1,N).
INFOINFOis INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, the leading minor of order i is not positive definite, and the solution has not been computed. The factorization has not been completed unlessi = N.
not the leading minor catching strays π if you get a positive INFO, the vibes are off and the solution just... isn't there. no solution for you, bestie.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
πΈ subroutine sptsvx πΈ
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. She does everything SPTSV does plus error bounds and a condition estimate β she's the overachiever of the family. π
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. Obsessed. π«Ά
Description:
The following steps are performed:
- 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. - If the leading i-by-i principal minor is not positive definite, 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
FACTFACTis CHARACTER*1- Specifies whether or not the factored form of
Ahas been 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.
NNis INTEGER- The order of the matrix
A.N >= 0.
NRHSNRHSis INTEGER- The number of right hand sides, i.e., the number of columns of the matrices
BandX.NRHS >= 0.
DDis REAL array, dimension(N)- The n diagonal elements of the tridiagonal matrix
A.
EEis REAL array, dimension(N-1)- The (n-1) subdiagonal elements of the tridiagonal matrix
A.
DFDFis REAL array, dimension(N)- If
FACT = 'F', thenDFis an input argument and on entry contains the n diagonal elements of the diagonal matrixDfrom theL*D*L**Tfactorization ofA. IfFACT = 'N', thenDFis an output argument and on exit contains the n diagonal elements of the diagonal matrixDfrom theL*D*L**Tfactorization ofA.
EFEFis REAL array, dimension(N-1)- 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. IfFACT = 'N', thenEFis an output argument and on exit contains the (n-1) subdiagonal elements of the unit bidiagonal factorLfrom theL*D*L**Tfactorization ofA.
BBis REAL array, dimension(LDB,NRHS)- The N-by-NRHS right hand side matrix
B.
LDBLDBis INTEGER- The leading dimension of the array
B.LDB >= max(1,N).
XXis REAL array, dimension(LDX,NRHS)- If
INFO = 0ofINFO = N+1, the N-by-NRHS solution matrixX.
LDXLDXis INTEGER- The leading dimension of the array
X.LDX >= max(1,N).
RCONDRCONDis 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.
FERRFERRis REAL array, dimension(NRHS)- The forward error bound for each solution vector
X(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).
BERRBERRis REAL array, dimension(NRHS)- The componentwise relative backward error of each solution vector
X(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).
WORKWORKis REAL array, dimension(2*N)
INFOINFOis INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, and i is<= N: the leading minor of order i ofAis not positive definite, 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.
bestie listen π ifRCONDis giving zero, the matrix is singular to working precision and that's a whole situation. and ifINFO = N+1? the matrix is singular to working precision but the routine is like "we ball" and computes the solution anyway, because sometimes the computed solution is more accurate thanRCONDwould have you believe. the audacity. the confidence. we love to see it. πβ¨
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π§ Author π§
Generated automatically by Doxygen for LAPACK from the source code. (not a human, just a robot doing its little thing, and honestly? it ate. π€π)
and that's the whole page, bestie!! every flag, every array dimension, every INFO code, all of it, no cap. go forth and solve those tridiagonal systems. you're the main character of linear algebra now. π
mwah π this was LAPACK Version 3.11.0, dated Sun Nov 27 2022 β big love to the LAPACK girlies, and to the realPTsolve(3) manual page for having us. periodt. πβ¨π¦
π¦ where this page comes from
- debian bookworm: liblapack-doc 3.11.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms