HPL_daxpy(3)
π HPL_daxpy β bestie's guide to the glow-up function π
okay so real quick: this page lives in the HPL Library Functions manual, section 3, and it's called HPL_daxpy. it's literally the "make y hotter by adding a scaled copy of x to it" function and i'm obsessed with her.
β¨ NAME β¨
HPL_daxpy β y := y + alpha * x.
like. that's the whole vibe. that's what she does. π
πΈ SYNOPSIS πΈ
#include "hpl.h"
void HPL_daxpy( const int N, const double ALPHA, const double * X, const
int INCX, double * Y, const int INCY );
she takes six things and gives you nothing back because she's a void queen π β she just does the thing.
π¦ DESCRIPTION π¦
HPL_daxpy scales the vector x by alpha and adds it to y.
no cap, that's it. take x, multiply it by alpha, yeet the result into y. main character energy, zero drama. π
π ARGUMENTS π
Nβ (local input)const int
On entry, N specifies the length of the vectors x and y. N must be at least zero. not negative, bestie. at least zero. π«Ά
ALPHAβ (local input)const double
On entry, ALPHA specifies the scalar alpha. When ALPHA is supplied as zero, then the entries of the incremented array X need not be set on input. so if alpha's a zero, x can be a total mystery and nobody cares πβ¨
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 specifies the increment for the elements of X. INCX must not be zero.
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. On exit, the entries of the incremented array Y are updated with the scaled entries of the incremented array X.
she's input and output β the way that she comes in one way and leaves completely transformed?? that's a glow-up fr fr π
INCYβ (local input)const int
On entry, INCY specifies the increment for the elements of Y. INCY must not be zero.
β οΈ heads up bestie:INCXandINCYmust not be zero. like, that's non-negotiable. zero increment = no. π
π EXAMPLE π
here's her serving in a tiny little main. so cute, so functional:
#include "hpl.h"
int main(int argc, char *argv[])
{
double x[3], y[3];
x[0] = 1.0; x[1] = 2.0; x[2] = 3.0;
y[0] = 4.0; y[1] = 5.0; y[2] = 6.0;
HPL_daxpy( 3, 2.0, x, 1, y, 1 );
printf("y=[%f,%f,%f]\n", y[0], y[1], y[2]);
exit(0); return(0);
}
she calls HPL_daxpy with N = 3, ALPHA = 2.0, X = x, INCX = 1, Y = y, INCY = 1, prints, and bounces. iconic behaviour, honestly. π
π§ SEE ALSO π§
HPL_dcopy (3)HPL_dscal (3)HPL_dswap (3)
the whole friend group. go say hi. π
this was HPL 2.2, dated February 24, 2016 β and that's the whole page, bestie. slay, stay safe, never pass a zero increment. 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