HPL_dtrsv(3)
π 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,ORDERspecifies the storage format of the operands, like this:ORDER = HplRowMajor,ORDER = HplColumnMajor.
UPLOβ (local input)const enum HPL_UPLOβ on entry,UPLOspecifies whether the upper or lower triangular part of the arrayAis to be referenced. WhenUPLO==HplUpper, only the upper triangular part ofAis to be referenced, otherwise only the lower triangular part ofAis 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,TRANSspecifies 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,DIAGspecifies whetherAis unit triangular or not. WhenDIAG==HplUnit,Ais assumed to be unit triangular, and otherwise,Ais not assumed to be unit triangular. iykyk.Nβ (local input)const intβ on entry,Nspecifies the order of the matrixA.Nmust be at least zero. (yes, zero is allowed, it's just a very small slay.)Aβ (local input)const double *β on entry,Apoints to an array of size equal to or greater thanLDA * n. Before entry withUPLO==HplUpper, the leadingnbynupper triangular part of the arrayAmust contain the upper triangular matrix and the strictly lower triangular part ofAis not referenced. WhenUPLO==HplLoweron entry, the leadingnbynlower triangular part of the arrayAmust contain the lower triangular matrix and the strictly upper triangular part ofAis 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,LDAspecifies the leading dimension ofAas declared in the calling (sub) program.LDAmust be at leastMAX(1,n). respect the stride. βXβ (local input/output)double *β on entry,Xis an incremented array of dimension at least( 1 + ( n - 1 ) * abs( INCX ) )that contains the vectorx. Before entry, the incremented arrayXmust contain thenelement right-hand side vectorb. On exit,Xis overwritten with the solution vectorx. it comes in asb, it leaves asx, glow-up of the century honestly. β¨INCXβ (local input)const intβ on entry,INCXspecifies the increment for the elements ofX.INCXmust 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
- fedora 43: hpl-doc 2.2-22.fc43 Β· LicenseRef-Callaway-BSD-with-advertising
- fedora 44: hpl-doc 2.2-23.fc44 Β· LicenseRef-Callaway-BSD-with-advertising
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms