SRC/sgtsvx.f(3)
SRC/sgtsvx.f(3) β Library Functions Manual β¨
π NAME π
SRC/sgtsvx.f β okay so this is the page for sgtsvx, and it's literally here to solve your tridiagonal-system era, bestie. π
β¨ SYNOPSIS β¨
Functions/Subroutines
subroutine sgtsvx (fact, trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, iwork, info)β SGTSVX computes the solution to system of linear equations A * X = B for GT matrices
πΈ Function/Subroutine Documentation πΈ
subroutine sgtsvx (...)
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: π
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.
Error bounds on the solution and a condition estimate are also provided.
π¦ Description: π¦
The following steps are performed:
- 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.
π Parameters π
FACTβFACT is CHARACTER*1. Specifies whether or not the factored form ofAhas been supplied on entry.
= 'F': DLF, DF, DUF, DU2, and IPIV contain the factored
form of A; DL, D, DU, DLF, DF, DUF, DU2 and IPIV
will not be modified.
= 'N': The matrix will be copied to DLF, DF, and DUF
and factored.
TRANSβTRANS is 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β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 matrixB.NRHS >= 0.DLβDL is REAL array, dimension (N-1). The(n-1)subdiagonal elements ofA.DβD is REAL array, dimension (N). Thendiagonal elements ofA.DUβDU is REAL array, dimension (N-1). The(n-1)superdiagonal elements ofA.DLFβDLF is 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βDF is 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βDUF is 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βDU2 is 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βIPIV is 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βB is REAL 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 REAL 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 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βFERR is 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β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 ofAorBthat makesX(j)an exact solution).WORKβWORK is REAL array, dimension (3*N).IWORKβIWORK is INTEGER array, dimension (N).INFOβINFO is INTEGER
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: if INFO = i, and i is
<= N: U(i,i) is exactly zero. The factorization
has not been completed unless i = N, but the
factor U is exactly singular, so the solution
and error bounds could not be computed.
RCOND = 0 is returned.
= N+1: U is nonsingular, but RCOND is 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 of RCOND would suggest.
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 290 of file sgtsvx.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
π That's the footer, bestie: LAPACK Version 3.12.0, SRC/sgtsvx.f(3), and no separate date line is given here, so that's the whole cute send-off. You ate that. Periodt. ππ
π«Ά
π¦ 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