HPL_dscal(3)

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

πŸ’– HPL_dscal(3) β€” the HPL library function that just... multiplies ur vector πŸ’…

okay so bestie, welcome to section 3 of the HPL manual, where the C functions live. this one is HPL_dscal, and honestly? she's an icon, she's a legend, and she does exactly one thing:

x = alpha * x.

that's it. that's the whole girl. ✨


🌸 NAME 🌸

HPL_dscal β€” x = alpha * x. no cap. that's the assignment statement, that's the vibe.


πŸŽ€ SYNOPSIS πŸŽ€

#include "hpl.h"

void HPL_dscal( const int N, const double ALPHA, double * X, const int
INCX );

πŸ¦‹ DESCRIPTION πŸ¦‹

HPL_dscal scales the vector x by alpha. that's it!! she takes ur vector, she takes ur scalar, she makes them become one (well, she multiplies every entry by it). main character energy, minimal effort, ate. πŸ”₯


✨ ARGUMENTS ✨

  • N β€” (local input) const int β€” on entry, N specifies the length of the vector x. and listen: N must be at least zero. not negative, okay? zero is fine, negative is not. 🫢
  • ALPHA β€” (local input) const double β€” on entry, ALPHA specifies the scalar alpha. here's the cute part: when ALPHA is supplied as zero, then the entries of the incremented array X need not be set on input. so like... if ur scaling by nothing, nobody even has to look at ur data first. lowkey iconic.
  • X β€” (local input/output) double * β€” on entry, X is an incremented array of dimension at least ( 1 + ( n - 1 ) * abs( INCX ) ) that contains the vector x. on exit, the entries of the incremented array X are scaled by the scalar alpha. so she goes in, she multiplies, she leaves. glow up achieved. πŸ’…
  • INCX β€” (local input) const int β€” on entry, INCX specifies the increment for the elements of X. and INCX must not be zero. like, do not. zero is not a slay here, it's a disaster. πŸ™ˆ

πŸ’œ EXAMPLE πŸ’œ

here's a lil demo so u can see her in her natural habitat:

#include "hpl.h"

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

three entries, scaled by 2.0, increment of 1. she's serving. πŸ’…


🌈 SEE ALSO 🌈

  • HPL_daxpy (3)
  • HPL_dcopy (3)
  • HPL_dswap (3)

her besties fr fr. the whole vector-ops group chat. 🫢


okay that's the page!! this was HPL 2.2, dated February 24, 2016, and it's the HPL_dscal(3) page from the HPL Library Functions. stay slay, scale responsibly, and remember: INCX is never zero. periodt. πŸ‘‘πŸ’–

πŸ“¦ where this page comes from