HPL_dlange(3)

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

πŸ’– 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:

  • norm1 denotes the one norm of a matrix, which is the maximum column sum.
  • normI denotes 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_NORM on entry, NORM specifies the value to be returned by this function, as described above. it's the little switch that picks your flavor. 🌈
  • M β€” (local input) const int on entry, M specifies the number of rows of the matrix A. M must be at least zero. (yes, at least zero. zero rows is a valid lifestyle choice.) πŸ“
  • N β€” (local input) const int on entry, N specifies the number of columns of the matrix A. N must be at least zero. same energy. πŸ“
  • A β€” (local input) const double * on entry, A points to an array of dimension (LDA,N), that contains the matrix A. it's your matrix. your baby. your data. 🫢
  • LDA β€” (local input) const int on entry, LDA specifies the leading dimension of the array A. LDA must be at least max(1,M). do not disrespect LDA, 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