HPL_dtrsv(3)

πŸ“¦ version 2.2, in fedora 43, fedora 44

πŸ’– HPL_dtrsv(3) β€” it's giving "solve the triangle, bestie" ✨

okay so this is a page from the HPL Library Functions manual and honestly? it's a whole vibe. buckle up, we're doing linear algebra πŸ’…


🌸 NAME 🌸

HPL_dtrsv β€” x := A^{-1} x.

periodt. that's the whole job. take your vector, un-multiply it by your triangular matrix. slay.


✨ SYNOPSIS ✨

#include "hpl.h"

void HPL_dtrsv( const enum HPL_ORDER ORDER, const enum HPL_UPLO UPLO,
const enum HPL_TRANS TRANS, const enum HPL_DIAG DIAG, const int N, const
double * A, const int LDA, double * X, const int INCX );

πŸ¦‹ DESCRIPTION πŸ¦‹

so HPL_dtrsv solves one of these two systems of equations, no cap:

A * x = b,   or   A^T * x = b,

where b and x are n-element vectors and A is an n by n non-unit, or unit, upper or lower triangular matrix. yes bestie, triangular. the good kind of matrix. the one where solving is actually doable. πŸŽ€

⚠️ no test for singularity or near-singularity is included in this routine. literally none. zero. the routine is not going to warn you, it's not going to hold your hand, it's going to rawdog that division. Such tests must be performed before calling this routine. so like… check first. πŸ™ˆ

πŸ‘‘ ARGUMENTS πŸ‘‘

  • ORDER β€” (local input) const enum HPL_ORDER β€” on entry, ORDER specifies the storage format of the operands, like this:
    • ORDER = HplRowMajor,
    • ORDER = HplColumnMajor.
  • UPLO β€” (local input) const enum HPL_UPLO β€” on entry, UPLO specifies whether the upper or lower triangular part of the array A is to be referenced. When UPLO==HplUpper, only the upper triangular part of A is to be referenced, otherwise only the lower triangular part of A is to be referenced. pick a lane, upper or lower, the function will not be doing both. πŸ’…
  • TRANS β€” (local input) const enum HPL_TRANS β€” on entry, TRANS specifies the equations to be solved, as follows:
    • TRANS==HplNoTrans β†’ A * x = b,
    • TRANS==HplTrans β†’ A^T * x = b.
  • DIAG β€” (local input) const enum HPL_DIAG β€” on entry, DIAG specifies whether A is unit triangular or not. When DIAG==HplUnit, A is assumed to be unit triangular, and otherwise, A is not assumed to be unit triangular. iykyk.
  • N β€” (local input) const int β€” on entry, N specifies the order of the matrix A. N must be at least zero. (yes, zero is allowed, it's just a very small slay.)
  • A β€” (local input) const double * β€” on entry, A points to an array of size equal to or greater than LDA * n. Before entry with UPLO==HplUpper, 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. When UPLO==HplLower on entry, 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==HplUnit, the diagonal elements of A not referenced either, but are assumed to be unity. so don't bother filling them in, they're imaginary besties.

  • LDA β€” (local input) const int β€” on entry, LDA specifies the leading dimension of A as declared in the calling (sub) program. LDA must be at least MAX(1,n). respect the stride. ⭐
  • X β€” (local input/output) double * β€” on entry, X is an incremented array of dimension at least ( 1 + ( n - 1 ) * abs( INCX ) ) that contains the vector x. 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. it comes in as b, it leaves as x, glow-up of the century honestly. ✨
  • INCX β€” (local input) const int β€” on entry, INCX specifies the increment for the elements of X. INCX must not be zero. do not set it to zero. that's the rule. πŸ’€

🌈 EXAMPLE 🌈

#include "hpl.h"

int main(int argc, char *argv[])
{
   double a[2*2], x[2];
   a[0] = 4.0; a[1] = 1.0; a[2] = 2.0; a[3] = 5.0;
   x[0] = 2.0; x[1] = 1.0;
   HPL_dtrsv( HplColumnMajor, HplLower, HplNoTrans,
              HplNoUnit, a, 2, x, 1 );
   printf("x=[%f,%f]\n", x[0], x[1]);
   exit(0); return(0);
}

look at that little program go. it ate. πŸ”₯


πŸŽ€ SEE ALSO πŸŽ€

  • HPL_dger (3)
  • HPL_dgemv (3)

and that's the whole page, bestie πŸ’œ this was HPL 2.2, dated February 24, 2016 β€” old but iconic, a true vintage. now go solve your triangle and drink some water. bye πŸ¦‹βœ¨

πŸ“¦ where this page comes from