realGTsolve(3)
β¨ realGTsolve(3) β LAPACK β¨
okay bestie, welcome to the GT matrix solve squad π this is the group of real solve driver functions for GT matrices. no cap, we're doing linear algebra and we're doing it cute. periodt.
πΈ NAME πΈ
realGTsolve - real
π SYNOPSIS π
π¦ Functions π¦
subroutine sgtsv (N, NRHS, DL, D, DU, B, LDB, INFO)βSGTSVcomputes 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)βSGTSVXcomputes the solution to system of linear equationsA * X = Bfor GT matrices.
π Detailed Description π
This is the group of real solve driver functions for GT matrices. that's the whole vibe, bestie. it's giving "we solve tridiagonal systems and we look good doing it". π
π₯ Function Documentation π₯
β subroutine sgtsv β
subroutine sgtsv (integer N, integer NRHS, real, dimension( * ) DL, real, dimension( * ) D, real, dimension( * ) DU, real, dimension( ldb, * ) B, integer LDB, integer INFO)
SGTSV computes the solution to system of linear equations A * X = B for GT matrices.
π― Purpose π―
SGTSV solves the equation
A*X = B,
where A is an n by n tridiagonal matrix, by Gaussian elimination with partial pivoting.
Note that the equation A**T*X = B may be solved by interchanging the order of the arguments DU and DL. iykyk, that's a little trick, no cap.
π Parameters π
NβNisINTEGER. 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.DLβDLisREAL array, dimension(N-1). On entry,DLmust contain the(n-1)sub-diagonal elements ofA.
On exit, DL is overwritten by the (n-2) elements of the second super-diagonal of the upper triangular matrix U from the LU factorization of A, in DL(1), ..., DL(n-2).
DβDisREAL array, dimension(N). On entry,Dmust contain the diagonal elements ofA.
On exit, D is overwritten by the n diagonal elements of U.
DUβDUisREAL array, dimension(N-1). On entry,DUmust contain the(n-1)super-diagonal elements ofA.
On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U.
BβBisREAL array, dimension(LDB,NRHS). On entry, theNbyNRHSmatrix of right hand side matrixB.
On exit, if INFO = 0, the N by NRHS solution matrix X.
LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).INFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value> 0: ifINFO = i,U(i,i)is exactly zero, and the solution has not been computed. The factorization has not been completed unlessi = N.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
β 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. obsessed, honestly. π
π Description π
The following steps are performed:
- If
FACT = 'N', theLUdecomposition 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βFACTisCHARACTER*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βTRANSisCHARACTER*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βNisINTEGER. 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.DLβDLisREAL array, dimension(N-1). The(n-1)subdiagonal elements ofA.DβDisREAL array, dimension(N). Thendiagonal elements ofA.DUβDUisREAL array, dimension(N-1). The(n-1)superdiagonal elements ofA.DLFβDLFisREAL array, dimension(N-1).- If
FACT = 'F', thenDLFis an input argument and on entry contains the(n-1)multipliers that define the matrixLfrom theLUfactorization ofAas computed bySGTTRF. - If
FACT = 'N', thenDLFis an output argument and on exit contains the(n-1)multipliers that define the matrixLfrom theLUfactorization ofA.
- If
DFβDFisREAL array, dimension(N).- If
FACT = 'F', thenDFis an input argument and on entry contains thendiagonal elements of the upper triangular matrixUfrom theLUfactorization ofA. - If
FACT = 'N', thenDFis an output argument and on exit contains thendiagonal elements of the upper triangular matrixUfrom theLUfactorization ofA.
- If
DUFβDUFisREAL 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βDU2isREAL 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βIPIVisINTEGER array, dimension(N).- If
FACT = 'F', thenIPIVis an input argument and on entry contains the pivot indices from theLUfactorization ofAas computed bySGTTRF. - If
FACT = 'N', thenIPIVis an output argument and on exit contains the pivot indices from theLUfactorization 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βBisREAL array, dimension(LDB,NRHS). TheN-by-NRHSright hand side matrixB.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisREAL array, dimension(LDX,NRHS). IfINFO = 0orINFO = N+1, theN-by-NRHSsolution matrixX.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDβRCONDisREAL. 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βFERRisREAL 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βBERRisREAL 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βWORKisREAL array, dimension(3*N).IWORKβIWORKisINTEGER array, dimension(N).INFOβ
Ok so back to INFO β this one is the receipts π§Ύ, bestie. It's an INTEGER, and what it tells you depends on its sign, so pay attention fr fr:
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.
Break it down with me π :
= 0β successful exit β¨ she did it, no notes, we love to see it.< 0β ifINFO = -i, then the i-th argument had an illegal value π¨. You passed something cursed, bestie, that's on you.> 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. It's giving "girl the math said no" π.= 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. So likeβ¦ don't panic, but also don't @ me πΈ.
β οΈ bestie warning: RCOND = 0 means the error bounds straight up do not exist. Do not go using them. Periodt.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Like, the whole academic Avengers assembled for this one π«Άπ
π Author
Generated automatically by Doxygen for LAPACK from the source code.
And that's the whole page, bestie!! π This little icon was served to you fresh from the LAPACK source code via Doxygen, Version 3.11.0, dated Sun Nov 27 2022 β so if anything here is giving slightly vintage, that's why π. Now go forth and realGTsolve responsibly, mwah π
β¨π¦
π¦ 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