SGTSVX(3)
Hey bestie! π This is SGTSVX(3), freshly unfolded from the Library Functions Manual. The page tag on this one is /home/abui...RC/sgtsvx.f(3), and it's giving tridiagonal linear solver main-character energy. β¨
πΈ NAME
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/sgtsvx.f
That's the source file this page is serving, bestie. π
β¨ SYNOPSIS
π§© Functions/Subroutines
subroutine SGTSVXβ SGTSVX computes the solution to system of linear equationsA * X = Bfor GT matrices.
subroutine SGTSVX (fact, trans, n, nrhs, dl, d, du, dlf, df, duf, du2,
ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, iwork, info)
π Function/Subroutine Documentation
Here's the full typed signature in all its glory β every type, every dimension, every argument, no skips:
subroutine SGTSVX (character fact, character trans, integer n, integer nrhs,
real, dimension( * ) dl, real, dimension( * ) d, real, dimension( * )
du, real, dimension( * ) dlf, real, dimension( * ) df, real, dimension(
* ) duf, real, dimension( * ) du2, integer, dimension( * ) ipiv, real,
dimension( ldb, * ) b, integer ldb, real, dimension( ldx, * ) x, integer
ldx, real rcond, real, dimension( * ) ferr, real, dimension( * ) berr,
real, dimension( * ) work, integer, dimension( * ) iwork, integer info)
SGTSVX computes the solution to system of linear equations A * X = B for GT matrices. π«Ά
π― Purpose
Okay so SGTSVX uses the LU factorization to compute the solution to a real system of linear equations A * X = B or A**T * X = B, where A is a tridiagonal matrix of order N and X and B are N-by-NRHS matrices.
It also hands you error bounds on the solution and a condition estimate. Obsessed. β¨
π§ Description
The routine does these steps, in this exact order:
- If
FACT = 'N', the LU decomposition is used to factor the matrixAasA = L * U, whereLis a product of permutation and unit lower bidiagonal matrices andUis upper triangular with nonzeros in only the main diagonal and first two superdiagonals. - If some
U(i,i)=0, so thatUis exactly singular, 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. - 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.
Bestie, step 2 is the dramatic one: ifU(i,i)=0, that factor is exactly singular and the routine bails withINFO = i. π
π Parameters
FACTβCHARACTER*1. Specifies whether or not the factored form ofAhas been supplied on entry.= 'F':DLF,DF,DUF,DU2, andIPIVcontain the factored form ofA;DL,D,DU,DLF,DF,DUF,DU2andIPIVwill not be modified.= 'N': The matrix will be copied toDLF,DF, andDUFand factored.
TRANSβCHARACTER*1. Specifies the form of the system of equations:= 'N':A * X = B(No transpose)= 'T':A**T * X = B(Transpose)= 'C':A**H * X = B(Conjugate transpose = Transpose)
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 matrixB.NRHS >= 0.DLβREAL array, dimension (N-1). The(n-1)subdiagonal elements ofA.DβREAL array, dimension (N). Thendiagonal elements ofA.DUβREAL array, dimension (N-1). The(n-1)superdiagonal elements ofA.DLFβREAL array, dimension (N-1).- If
FACT = 'F', thenDLFis an input argument and on entry contains the(n-1)multipliers that define the matrixLfrom the LU factorization ofAas computed bySGTTRF. - If
FACT = 'N', thenDLFis an output argument and on exit contains the(n-1)multipliers that define the matrixLfrom the LU factorization ofA.
- If
DFβREAL array, dimension (N).- If
FACT = 'F', thenDFis an input argument and on entry contains thendiagonal elements of the upper triangular matrixUfrom the LU factorization ofA. - If
FACT = 'N', thenDFis an output argument and on exit contains thendiagonal elements of the upper triangular matrixUfrom the LU factorization ofA.
- If
DUFβREAL array, dimension (N-1).- If
FACT = 'F', thenDUFis an input argument and on entry contains the(n-1)elements of the first superdiagonal ofU. - If
FACT = 'N', thenDUFis an output argument and on exit contains the(n-1)elements of the first superdiagonal ofU.
- If
DU2βREAL array, dimension (N-2).- If
FACT = 'F', thenDU2is an input argument and on entry contains the(n-2)elements of the second superdiagonal ofU. - If
FACT = 'N', thenDU2is an output argument and on exit contains the(n-2)elements of the second superdiagonal ofU.
- If
IPIVβINTEGER array, dimension (N).- If
FACT = 'F', thenIPIVis an input argument and on entry contains the pivot indices from the LU factorization ofAas computed bySGTTRF. - If
FACT = 'N', thenIPIVis an output argument and on exit contains the pivot indices from the LU factorization ofA; rowiof the matrix was interchanged with rowIPIV(i).IPIV(i)will always be eitheriori+1;IPIV(i) = iindicates a row interchange was not required.
- If
BβREAL array, dimension (LDB,NRHS). TheN-by-NRHSright hand side matrixB.LDBβINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβREAL array, dimension (LDX,NRHS). IfINFO = 0orINFO = N+1, theN-by-NRHSsolution matrixX.LDXβINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDβREAL. The estimate of 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βREAL array, dimension (NRHS). The estimated 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). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error.BERRβREAL 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βREAL array, dimension (3*N).IWORKβINTEGER array, dimension (N).INFOβINTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value> 0: ifINFO = i, andiis<= N:U(i,i)is exactly zero. The factorization has not been completed unlessi = N, but the factorUis exactly singular, so the solution and error bounds could not be 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 290 of file sgtsvx.f.
πͺ Author β auto-generated edition
Generated automatically by Doxygen for LAPACK from the source code.
Final footer vibes, bestie: LAPACK Version 3.12.0 and the page tag /home/abui...RC/sgtsvx.f(3). Go off and solve those tridiagonal systems. πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms