HPL_daxpy(3)

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

πŸ’– 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: INCX and INCY must 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