HPL_dlange(3)
π HPL_dlange β it's giving "how big is this matrix bestie" π
okay so real quick before we get into it: this page is HPL_dlange(3), and it lives in the HPL Library Functions section of the manual. yes we're doing linear algebra. yes i'm gonna make it cute. no cap. π
β¨ NAME β¨
HPL_dlange β compute ||A||. that's it, that's the whole vibe. a norm. a single number that describes your matrix. iconic behavior honestly. π
πΈ SYNOPSIS πΈ
#include "hpl.h"
double HPL_dlange( const HPL_T_NORM NORM, const int M, const int N,
const double * A, const int LDA );
like look at that signature. double coming back at you. const everywhere because we are not touching your data, we are simply observing. main character energy fr. π¦
π DESCRIPTION π
so HPL_dlange hands you back the value of the one norm, or the infinity norm, or the element of largest absolute value of a matrix A. three moods, one function. we love a versatile queen. β¨
here's the tea, exactly which one you get depends on NORM:
max(abs(A(i,j))) when NORM = HPL_NORM_A,
norm1(A), when NORM = HPL_NORM_1,
normI(A), when NORM = HPL_NORM_I,
and what are norm1 and normI you ask? bestie i got you:
norm1denotes the one norm of a matrix, which is the maximum column sum.normIdenotes the infinity norm of a matrix, which is the maximum row sum.
β οΈ also important, and the original is very clear about this: note that max(abs(A(i,j))) is not a matrix norm. it's just the biggest absolute value hanging out in there. it's giving "imposter syndrome" but make it math. π
π ARGUMENTS π
every single one of them, no skipping, no summarizing, we respect the API in this house:
NORMβ (local input)const HPL_T_NORMon entry,NORMspecifies the value to be returned by this function, as described above. it's the little switch that picks your flavor. πMβ (local input)const inton entry,Mspecifies the number of rows of the matrixA.Mmust be at least zero. (yes, at least zero. zero rows is a valid lifestyle choice.) πNβ (local input)const inton entry,Nspecifies the number of columns of the matrixA.Nmust be at least zero. same energy. πAβ (local input)const double *on entry,Apoints to an array of dimension(LDA,N), that contains the matrixA. it's your matrix. your baby. your data. π«ΆLDAβ (local input)const inton entry,LDAspecifies the leading dimension of the arrayA.LDAmust be at leastmax(1,M). do not disrespectLDA, she has rules and the rules are strict. π
π¦ EXAMPLE π¦
here's a whole little program, verbatim, so you can see it in the wild:
#include "hpl.h"
int main(int argc, char *argv[])
{
double a[2*2];
a[0] = 1.0; a[1] = 3.0; a[2] = 2.0; a[3] = 4.0;
norm = HPL_dlange( HPL_NORM_I, 2, 2, a, 2 );
printf("norm=%f\n", norm);
exit(0); return(0);
}
look at her go. 2 by 2 matrix, HPL_NORM_I requested, LDA of 2, and then we printf the result. slay. π₯
π SEE ALSO π
go read these next, bestie, they're the supporting cast:
HPL_dlaprnt (3)HPL_fprintf (3)
π§ and that's the whole page!! go forth and compute your norms, you absolute legend. ily, mwah π
this was HPL 2.2, dated February 24, 2016 β sourced straight from the HPL crew, and rewritten with love by your favorite unix bestie. periodt. π
β¨
π¦ 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