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) β†’ CTRSV
  • subroutine dtrsv (uplo, trans, diag, n, a, lda, x, incx) β†’ DTRSV
  • subroutine strsv (uplo, trans, diag, n, a, lda, x, incx) β†’ STRSV
  • subroutine 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 β€” is CHARACTER*1. on entry, UPLO tells us whether the matrix is upper or lower triangular, like this:
    • UPLO = 'U' or 'u' β†’ A is an upper triangular matrix.
    • UPLO = 'L' or 'l' β†’ A is a lower triangular matrix.
  • TRANS β€” is CHARACTER*1. on entry, TRANS says 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 β€” is CHARACTER*1. on entry, DIAG says whether or not A is unit triangular, like this:
    • DIAG = 'U' or 'u' β†’ A is assumed to be unit triangular.
    • DIAG = 'N' or 'n' β†’ A is not assumed to be unit triangular.
  • N β€” is INTEGER. on entry, N is the order of the matrix A. N must be at least zero.
  • A β€” is COMPLEX array, dimension ( LDA, N ). before entry with UPLO = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triangular matrix, and the strictly lower triangular part of A is not referenced. before entry with UPLO = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular matrix, and the strictly upper triangular part of A is not referenced.
🫢 also note: when DIAG = 'U' or 'u', the diagonal elements of A are not referenced either β€” they're just assumed to be unity. iconic behaviour honestly.
  • LDA β€” is INTEGER. on entry, LDA is the first dimension of A as declared in the calling (sub) program. LDA must be at least max( 1, n ).
  • X β€” is COMPLEX array, dimension at least ( 1 + ( n - 1 )*abs( INCX ) ). before entry, the incremented array X must contain the n element right-hand side vector b. on exit, X is overwritten with the solution vector x. πŸ”₯
  • INCX β€” is INTEGER. on entry, INCX is the increment for the elements of X. INCX must 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 β€” is CHARACTER*1. on entry, UPLO specifies 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 β€” is CHARACTER*1. on entry, TRANS specifies 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 β€” is CHARACTER*1. on entry, DIAG specifies 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 β€” is INTEGER. on entry, N specifies the order of the matrix A. N must be at least zero.
  • A β€” is DOUBLE PRECISION array, dimension ( LDA, N ). before entry with UPLO = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triangular matrix and the strictly lower triangular part of A is not referenced. before entry with UPLO = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular matrix and the strictly upper triangular part of A is not referenced.
πŸ¦‹ note that when DIAG = 'U' or 'u', the diagonal elements of A are not referenced either, but are assumed to be unity.
  • LDA β€” is INTEGER. on entry, LDA specifies the first dimension of A as declared in the calling (sub) program. LDA must be at least max( 1, n ).
  • X β€” is DOUBLE PRECISION array, dimension at least ( 1 + ( n - 1 )*abs( INCX ) ). before entry, the incremented array X must contain the n element right-hand side vector b. on exit, X is overwritten with the solution vector x.
  • INCX β€” is INTEGER. on entry, INCX specifies the increment for the elements of X. INCX must not be zero.
πŸ™ˆ fun formatting moment: in dtrsv this next bit is printed inside the INCX blurb 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 β€” is CHARACTER*1. on entry, UPLO specifies 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 β€” is CHARACTER*1. on entry, TRANS specifies 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 β€” is CHARACTER*1. on entry, DIAG specifies 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 β€” is INTEGER. on entry, N specifies the order of the matrix A. N must 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 with UPLO = 'U' or 'u', the leading n by n upper triangular part of A has to actually contain the upper triangular matrix, and the strictly lower triangular part of A is not referenced (so like, ghost it, bestie, nobody's looking at it). Before entry with UPLO = 'L' or 'l', it flips: the leading n by n lower triangular part of A must contain the lower triangular matrix, and the strictly upper triangular part of A is not referenced. And note β€” when DIAG = 'U' or 'u', the diagonal elements of A are not referenced either, they're just assumed to be unity. Assumed!! The audacity, honestly. πŸ’…
  • LDA β€” LDA is INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. LDA must be at least max( 1, n ). Non-negotiable, fr fr.
  • X β€” X is REAL array, dimension at least ( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremented array X must contain the n element right-hand side vector b. On exit, X is overwritten with the solution vector x. Yes, overwritten β€” she takes the wheel and doesn't give it back. πŸš—
  • INCX β€” INCX is INTEGER. On entry, INCX specifies the increment for the elements of X. INCX must 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:

ZTRSV 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.

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 β€” UPLO is CHARACTER*1. On entry, UPLO specifies 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 β€” TRANS is CHARACTER*1. On entry, TRANS specifies 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 β€” DIAG is CHARACTER*1. On entry, DIAG specifies 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 β€” N is INTEGER. On entry, N specifies the order of the matrix A. N must be at least zero. Zero is allowed! Slay, an empty matrix, we respect her. πŸŽ€
  • A β€” A is COMPLEX*16 array, dimension ( LDA, N ). Before entry with UPLO = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triangular matrix and the strictly lower triangular part of A is not referenced. Before entry with UPLO = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular matrix and the strictly upper triangular part of A is not referenced. Note that when DIAG = 'U' or 'u', the diagonal elements of A are not referenced either, but are assumed to be unity. Same deal as her real sister β€” assumed unity, don't @ her. πŸ¦‹
  • LDA β€” LDA is INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. LDA must be at least max( 1, n ). Periodt. πŸ”₯
  • X β€” X is COMPLEX*16 array, dimension at least ( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremented array X must contain the n element right-hand side vector b. On exit, X is overwritten with the solution vector x. Again β€” overwritten. She ate and left no crumbs. πŸ“
  • INCX β€” INCX is INTEGER. On entry, INCX specifies the increment for the elements of X. INCX must 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