trsv(3)
π
trsv(3) β like, the whole trsv situation (part 1 of 2)
okay bestie gather round, this is a page from the Library Functions Manual and it's literally all about trsv, which is the triangular matrix-vector solve. it's a whole family of routines, one per flavour of numbers, and we're doing this properly so nothing gets skipped. let's go β¨
π NAME
trsv β trsv: triangular matrix-vector solve
yep that's it, that's the whole vibe. it solves. triangularly. π
πΈ SYNOPSIS
β¨ Functions
subroutine ctrsv (uplo, trans, diag, n, a, lda, x, incx)βCTRSVsubroutine dtrsv (uplo, trans, diag, n, a, lda, x, incx)βDTRSVsubroutine strsv (uplo, trans, diag, n, a, lda, x, incx)βSTRSVsubroutine ztrsv (uplo, trans, diag, n, a, lda, x, incx)βZTRSV
four routines, same argument list, different number types. it's giving matching friendship bracelets fr fr π«Ά
π¦ Detailed Description
π Function Documentation
subroutine ctrsv</p> (character uplo, character trans, character diag, integer n, complex, dimension(lda,) a, integer lda, complex, dimension() x, integer incx)
π CTRSV
Purpose:
!>
!> CTRSV solves one of the systems of equations
!>
!> A*x = b, or A**T*x = b, or A**H*x = b,
!>
!> where b and x are n element vectors and A is an n by n unit, or
!> non-unit, upper or lower triangular matrix.
!>
!> No test for singularity or near-singularity is included in this
!> routine. Such tests must be performed before calling this routine.
!>
so like, CTRSV solves one of those three systems up there β A*x = b, or A**T*x = b, or A**H*x = b β where b and x are n element vectors and A is an n by n unit or non-unit, upper or lower triangular matrix.
β οΈ read this twice bestie: there is no test for singularity or near-singularity built into this routine. none. zero. you gotta do those tests yourself before you call it. don't come crying to CTRSV when your matrix is a mess π
Parameters:
UPLOβ isCHARACTER*1. on entry,UPLOtells us whether the matrix is upper or lower triangular, like this:UPLO = 'U'or'u'βAis an upper triangular matrix.UPLO = 'L'or'l'βAis a lower triangular matrix.
TRANSβ isCHARACTER*1. on entry,TRANSsays which equation we're solving, as follows:TRANS = 'N'or'n'βA*x = b.TRANS = 'T'or't'βA**T*x = b.TRANS = 'C'or'c'βA**H*x = b.
DIAGβ isCHARACTER*1. on entry,DIAGsays whether or notAis unit triangular, like this:DIAG = 'U'or'u'βAis assumed to be unit triangular.DIAG = 'N'or'n'βAis not assumed to be unit triangular.
Nβ isINTEGER. on entry,Nis the order of the matrixA.Nmust be at least zero.Aβ isCOMPLEXarray, dimension( LDA, N ). before entry withUPLO = 'U'or'u', the leadingnbynupper triangular part of the arrayAmust contain the upper triangular matrix, and the strictly lower triangular part ofAis not referenced. before entry withUPLO = 'L'or'l', the leadingnbynlower triangular part of the arrayAmust contain the lower triangular matrix, and the strictly upper triangular part ofAis not referenced.
π«Ά also note: whenDIAG = 'U'or'u', the diagonal elements ofAare not referenced either β they're just assumed to be unity. iconic behaviour honestly.
LDAβ isINTEGER. on entry,LDAis the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, n ).Xβ isCOMPLEXarray, dimension at least( 1 + ( n - 1 )*abs( INCX ) ). before entry, the incremented arrayXmust contain thenelement right-hand side vectorb. on exit,Xis overwritten with the solution vectorx. π₯INCXβ isINTEGER. on entry,INCXis the increment for the elements ofX.INCXmust not be zero.
Author:
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
!>
!> Level 2 Blas routine.
!>
!> -- Written on 22-October-1986.
!> Jack Dongarra, Argonne National Lab.
!> Jeremy Du Croz, Nag Central Office.
!> Sven Hammarling, Nag Central Office.
!> Richard Hanson, Sandia National Labs.
!>
that's a Level 2 BLAS routine, written way back on 22-October-1986 by Jack Dongarra (Argonne National Lab), Jeremy Du Croz (Nag Central Office), Sven Hammarling (Nag Central Office) and Richard Hanson (Sandia National Labs). literal legends, we stan π
Definition at line 148 of file ctrsv.f.
subroutine dtrsv</p> (character uplo, character trans, character diag, integer n, double precision, dimension(lda,) a, integer lda, double precision, dimension() x, integer incx)
π DTRSV
Purpose:
!>
!> DTRSV solves one of the systems of equations
!>
!> A*x = b, or A**T*x = b,
!>
!> where b and x are n element vectors and A is an n by n unit, or
!> non-unit, upper or lower triangular matrix.
!>
!> No test for singularity or near-singularity is included in this
!> routine. Such tests must be performed before calling this routine.
!>
DTRSV solves one of the two systems up there β note there's no A**H*x = b here, because these are DOUBLE PRECISION numbers and conjugate transpose is a whole complex-number thing, iykyk π β where b and x are n element vectors and A is an n by n unit or non-unit, upper or lower triangular matrix.
β οΈ same deal as before, no cap: no test for singularity or near-singularity is included in this routine. such tests must be performed before calling this routine. do your homework first bestie.
Parameters:
UPLOβ isCHARACTER*1. on entry,UPLOspecifies whether the matrix is an upper or lower triangular matrix, as follows:UPLO = 'U'or'u'βAis an upper triangular matrix.UPLO = 'L'or'l'βAis a lower triangular matrix.
TRANSβ isCHARACTER*1. on entry,TRANSspecifies the equations to be solved, as follows:TRANS = 'N'or'n'βA*x = b.TRANS = 'T'or't'βA**T*x = b.TRANS = 'C'or'c'βA**T*x = b.
DIAGβ isCHARACTER*1. on entry,DIAGspecifies whether or notAis unit triangular, as follows:DIAG = 'U'or'u'βAis assumed to be unit triangular.DIAG = 'N'or'n'βAis not assumed to be unit triangular.
Nβ isINTEGER. on entry,Nspecifies the order of the matrixA.Nmust be at least zero.Aβ isDOUBLE PRECISIONarray, dimension( LDA, N ). before entry withUPLO = 'U'or'u', the leadingnbynupper triangular part of the arrayAmust contain the upper triangular matrix and the strictly lower triangular part ofAis not referenced. before entry withUPLO = 'L'or'l', the leadingnbynlower triangular part of the arrayAmust contain the lower triangular matrix and the strictly upper triangular part ofAis not referenced.
π¦ note that whenDIAG = 'U'or'u', the diagonal elements ofAare not referenced either, but are assumed to be unity.
LDAβ isINTEGER. on entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, n ).Xβ isDOUBLE PRECISIONarray, dimension at least( 1 + ( n - 1 )*abs( INCX ) ). before entry, the incremented arrayXmust contain thenelement right-hand side vectorb. on exit,Xis overwritten with the solution vectorx.INCXβ isINTEGER. on entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero.
π fun formatting moment: indtrsvthis next bit is printed inside theINCXblurb instead of in its own section, but it's the same info, so here it is verbatim:
!>
!> Level 2 Blas routine.
!>
!> -- Written on 22-October-1986.
!> Jack Dongarra, Argonne National Lab.
!> Jeremy Du Croz, Nag Central Office.
!> Sven Hammarling, Nag Central Office.
!> Richard Hanson, Sandia National Labs.
!>
Author:
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 142 of file dtrsv.f.
subroutine strsv</p> (character uplo, character trans, character diag, integer n, real, dimension(lda,) a, integer lda, real, dimension() x, integer incx)
π STRSV
Purpose:
!>
!> STRSV solves one of the systems of equations
!>
!> A*x = b, or A**T*x = b,
!>
!> where b and x are n element vectors and A is an n by n unit, or
!> non-unit, upper or lower triangular matrix.
!>
!> No test for singularity or near-singularity is included in this
!> routine. Such tests must be performed before calling this routine.
!>
STRSV is the REAL-numbers one π β solves A*x = b or A**T*x = b, where b and x are n element vectors and A is an n by n unit or non-unit, upper or lower triangular matrix. again, no A**H situation, because real numbers don't do that.
β οΈ and again, for the people in the back: no test for singularity or near-singularity is included in this routine. such tests must be performed before calling this routine. periodt.
Parameters:
UPLOβ isCHARACTER*1. on entry,UPLOspecifies whether the matrix is an upper or lower triangular matrix, as follows:UPLO = 'U'or'u'βAis an upper triangular matrix.UPLO = 'L'or'l'βAis a lower triangular matrix.
TRANSβ isCHARACTER*1. on entry,TRANSspecifies the equations to be solved, as follows:TRANS = 'N'or'n'βA*x = b.TRANS = 'T'or't'βA**T*x = b.TRANS = 'C'or'c'βA**T*x = b.
DIAGβ isCHARACTER*1. on entry,DIAGspecifies whether or notAis unit triangular, as follows:DIAG = 'U'or'u'βAis assumed to be unit triangular.DIAG = 'N'or'n'βAis not assumed to be unit triangular.
Nβ isINTEGER. on entry,Nspecifies the order of the matrixA.Nmust be at least zero.
β¦and that's where this half of the page runs out β the A parameter of STRSV picks up in part 2, no spoilers π
β¨
Aβ a REAL array, dimension( LDA, N ). Before you come in withUPLO = 'U'or'u', the leading n by n upper triangular part ofAhas to actually contain the upper triangular matrix, and the strictly lower triangular part ofAis not referenced (so like, ghost it, bestie, nobody's looking at it). Before entry withUPLO = 'L'or'l', it flips: the leading n by n lower triangular part ofAmust contain the lower triangular matrix, and the strictly upper triangular part ofAis not referenced. And note β whenDIAG = 'U'or'u', the diagonal elements ofAare not referenced either, they're just assumed to be unity. Assumed!! The audacity, honestly. πLDAβLDAis INTEGER. On entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, n ). Non-negotiable, fr fr.XβXis REAL array, dimension at least( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain the n element right-hand side vector b. On exit,Xis overwritten with the solution vector x. Yes, overwritten β she takes the wheel and doesn't give it back. πINCXβINCXis INTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Like, ever. Zero is not the vibe. π
π«Ά Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
πΈ Further Details:
Level 2 Blas routine.
And the origin story, because we love a receipt:
-- Written on 22-October-1986.
Jack Dongarra, Argonne National Lab.
Jeremy Du Croz, Nag Central Office.
Sven Hammarling, Nag Central Office.
Richard Hanson, Sandia National Labs.
Definition at line 148 of file strsv.f. Iconic. π
π ztrsv π
Okay bestie, now the complex one. Same energy, bigger numbers, more drama β¨
subroutine ztrsv (character uplo, character trans, character diag, integer
n, complex*16, dimension(lda,*) a, integer lda, complex*16, dimension(*)
x, integer incx)
π― Purpose:
ZTRSVsolves one of the systems of equationsA*x = b, or A**T*x = b, or A**H*x = b,where b and x are n element vectors and A is an n by n unit, or non-unit, upper or lower triangular matrix.
And the warning that matters, no cap:
No test for singularity or near-singularity is included in this routine. Such tests must be performed before calling this routine.
So likeβ¦ she will not be checking if your matrix is a mess. That's on you, babes. Do your own vibe check first. π
β¨ Parameters
UPLOβUPLOisCHARACTER*1. On entry,UPLOspecifies whether the matrix is an upper or lower triangular matrix, as follows:UPLO = 'U'or'u'β A is an upper triangular matrix.UPLO = 'L'or'l'β A is a lower triangular matrix.
TRANSβTRANSisCHARACTER*1. On entry,TRANSspecifies the equations to be solved, as follows:TRANS = 'N'or'n'βA*x = b.TRANS = 'T'or't'βA**T*x = b.TRANS = 'C'or'c'βA**H*x = b.
DIAGβDIAGisCHARACTER*1. On entry,DIAGspecifies whether or not A is unit triangular, as follows:DIAG = 'U'or'u'β A is assumed to be unit triangular.DIAG = 'N'or'n'β A is not assumed to be unit triangular.
NβNis INTEGER. On entry,Nspecifies the order of the matrix A.Nmust be at least zero. Zero is allowed! Slay, an empty matrix, we respect her. πAβAisCOMPLEX*16array, dimension( LDA, N ). Before entry withUPLO = 'U'or'u', the leading n by n upper triangular part of the arrayAmust contain the upper triangular matrix and the strictly lower triangular part ofAis not referenced. Before entry withUPLO = 'L'or'l', the leading n by n lower triangular part of the arrayAmust contain the lower triangular matrix and the strictly upper triangular part ofAis not referenced. Note that whenDIAG = 'U'or'u', the diagonal elements ofAare not referenced either, but are assumed to be unity. Same deal as her real sister β assumed unity, don't @ her. π¦LDAβLDAis INTEGER. On entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, n ). Periodt. π₯XβXisCOMPLEX*16array, dimension at least( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain the n element right-hand side vector b. On exit,Xis overwritten with the solution vector x. Again β overwritten. She ate and left no crumbs. πINCXβINCXis INTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Hard no on zero, bestie. π
π«Ά Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details:
Level 2 Blas routine.
Same legendary origin, same date, same four icons:
-- Written on 22-October-1986.
Jack Dongarra, Argonne National Lab.
Jeremy Du Croz, Nag Central Office.
Sven Hammarling, Nag Central Office.
Richard Hanson, Sandia National Labs.
Definition at line 148 of file ztrsv.f. π
π§ Author
Generated automatically by Doxygen for LAPACK from the source code. Not a human, just a little robot doing her best π«Ά
And that's the whole page, bestie β every last triangle, every last !> comment, all of it. This lil masterpiece is from LAPACK, Version 3.12.0, and yes the footer says trsv(3) because we're fancy and documented π
β¨ Go solve your triangular systems, you absolute main character π
π¦ 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