HPL_dgemv(3)
π 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,ORDERtells us the storage format of the operands, like so:ORDER = HplRowMajor,ORDER = HplColumnMajor.
TRANSβ (local input)const enum HPL_TRANSβ on entry,TRANSsays 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,Mis the number of rows of the matrixA.Mmust be at least zero. no negative row counts, that's not a vibe. π«Nβ (local input)const intβ on entry,Nis the number of columns of the matrixA.Nmust be at least zero.ALPHAβ (local input)const doubleβ on entry,ALPHAis the scalar alpha. and here's the tea: whenALPHAis supplied as zero, thenAandXneed not be set on input. free pass, slay. β¨Aβ (local input)const double *β on entry,Apoints to an array of size equal to or greater thanLDA * n. before entry, the leading m by n part of the arrayAmust contain the matrix coefficients. that's it, that's the job.LDAβ (local input)const intβ on entry,LDAis the leading dimension ofAas declared in the calling (sub) program.LDAmust be at leastMAX(1,m). respect the boundary bestie. πXβ (local input)const double *β on entry,Xis an incremented array of dimension at least( 1 + ( n - 1 ) * abs( INCX ) )that contains the vector x.INCXβ (local input)const intβ on entry,INCXis the increment for the elements ofX.INCXmust not be zero. zero is not allowed, do not try it. πBETAβ (local input)const doubleβ on entry,BETAis the scalar beta. and whenALPHAis supplied as zero thenYneed not be set on input. (yes, the original saysALPHAhere β we report, we don't editorialise π«Ά)Yβ (local input/output)double *β on entry,Yis an incremented array of dimension at least( 1 + ( n - 1 ) * abs( INCY ) )that contains the vector y. before entry withBETAnon-zero, the incremented arrayYmust contain the vector y. on exit,Yis overwritten by the updated vector y. glow-up complete, she's different now. π₯INCYβ (local input)const intβ on entry,INCYis the increment for the elements ofY.INCYmust not be zero. same rule asINCX, 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
- 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