HPL_dgemv(3)

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

πŸ’– HPL_dgemv β€” the glow-up matrix-vector moment πŸ’–

okay bestie, this is a page from the HPL Library Functions manual, and honestly? it's giving iconic. sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

HPL_dgemv β€” literally just: y := beta * y + alpha * op(A) * x. that's the whole vibe. periodt. πŸ’…


🌸 SYNOPSIS 🌸

#include "hpl.h"

void HPL_dgemv( const enum HPL_ORDER ORDER, const enum HPL_TRANS TRANS,
const int M, const int N, const double ALPHA, const double * A, const
int LDA, const double * X, const int INCX, const double BETA, double *
Y, const int INCY );

look at all those parameters. main character energy fr fr. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so HPL_dgemv performs one of these matrix-vector operations:

y := alpha * op( A ) * x + beta * y,

and op( X ) is one of these two, no in-between:

op( X ) = X   or   op( X ) = X^T.

here alpha and beta are scalars, x and y are vectors, and A is an m by n matrix. yes bestie, that's the whole plot. πŸŽ€


πŸ’œ ARGUMENTS πŸ’œ

  • ORDER β€” (local input) const enum HPL_ORDER β€” on entry, ORDER tells us the storage format of the operands, like so:
    • ORDER = HplRowMajor,
    • ORDER = HplColumnMajor.
  • TRANS β€” (local input) const enum HPL_TRANS β€” on entry, TRANS says which operation we're doing, and the options are:
    • TRANS = HplNoTrans y := alpha*A *x + beta*y,
    • TRANS = HplTrans y := alpha*A^T*x + beta*y.
  • M β€” (local input) const int β€” on entry, M is the number of rows of the matrix A. M must be at least zero. no negative row counts, that's not a vibe. 🚫
  • N β€” (local input) const int β€” on entry, N is the number of columns of the matrix A. N must be at least zero.
  • ALPHA β€” (local input) const double β€” on entry, ALPHA is the scalar alpha. and here's the tea: when ALPHA is supplied as zero, then A and X need not be set on input. free pass, slay. ✨
  • A β€” (local input) const double * β€” on entry, A points to an array of size equal to or greater than LDA * n. before entry, the leading m by n part of the array A must contain the matrix coefficients. that's it, that's the job.
  • LDA β€” (local input) const int β€” on entry, LDA is the leading dimension of A as declared in the calling (sub) program. LDA must be at least MAX(1,m). respect the boundary bestie. πŸ™
  • X β€” (local input) const double * β€” on entry, X is an incremented array of dimension at least ( 1 + ( n - 1 ) * abs( INCX ) ) that contains the vector x.
  • INCX β€” (local input) const int β€” on entry, INCX is the increment for the elements of X. INCX must not be zero. zero is not allowed, do not try it. πŸ’€
  • BETA β€” (local input) const double β€” on entry, BETA is the scalar beta. and when ALPHA is supplied as zero then Y need not be set on input. (yes, the original says ALPHA here β€” we report, we don't editorialise 🫢)
  • Y β€” (local input/output) double * β€” on entry, Y is an incremented array of dimension at least ( 1 + ( n - 1 ) * abs( INCY ) ) that contains the vector y. before entry with BETA non-zero, the incremented array Y must contain the vector y. on exit, Y is overwritten by the updated vector y. glow-up complete, she's different now. πŸ”₯
  • INCY β€” (local input) const int β€” on entry, INCY is the increment for the elements of Y. INCY must not be zero. same rule as INCX, no zeros allowed. ⭐

🌈 EXAMPLE 🌈

here's a lil demo, verbatim, copy it and go off:

#include "hpl.h"

int main(int argc, char *argv[])
{
   double a[2*2], x[2], y[2];
   a[0] = 1.0; a[1] = 2.0; a[2] = 3.0; a[3] = 3.0;
   x[0] = 2.0; x[1] = 1.0; y[2] = 1.0; y[3] = 2.0;
   HPL_dgemv( HplColumnMajor, HplNoTrans, 2, 2, 2.0,
              a, 2, x, 1, -1.0, y, 1 );
   printf("y=[%f,%f]\n", y[0], y[1]);
   exit(0); return(0);
}

πŸ‘€ SEE ALSO πŸ‘€

  • HPL_dger (3)
  • HPL_dtrsv (3)

go read those too, they're the friend group. 🫢


ngl this page is from HPL 2.2, dated February 24, 2016, and it's still serving. iykyk. πŸ’–

bye bestie, go multiply something. πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from