HPL_dcopy(3)

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

πŸ’– HPL_dcopy(3) πŸ’–

okay bestie, gather round, because we're talking about HPL_dcopy from the HPL Library Functions and it's literally the simplest slay in the whole library. no cap. 🫢


✨ NAME ✨

HPL_dcopy β€” it does y := x. that's it. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include "hpl.h"

void HPL_dcopy( const int N, const double * X, const int INCX, double *
Y, const int INCY );

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, HPL_dcopy copies the vector x into the vector y. it's giving "i have a vibe and i'm putting it somewhere else." iconic behaviour honestly. ✨


πŸ‘‘ ARGUMENTS πŸ‘‘

  • N (local input) const int β€” on entry, N specifies the length of the vectors x and y. and listen, N must be at least zero, okay? we do not do negative lengths in this house. 🚫
  • 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. yes the formula is doing the most, but she's right. πŸ’…
  • INCX (local input) const int β€” on entry, INCX specifies the increment for the elements of X. and INCX must not be zero, fr fr. zero increment is not the move. πŸ™ˆ
  • 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 entries of the incremented array X. so she goes in as one thing and comes out as a whole new girlie. main character transformation arc. πŸ¦‹βœ¨
  • INCY (local input) const int β€” on entry, INCY specifies the increment for the elements of Y. INCY must not be zero. periodt. πŸ‘‘

🌈 EXAMPLE 🌈

here's the demo bestie, and yes you can run it, she works:

#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_dcopy( 3, x, 1, y, 1 );
   printf("y=[%f,%f,%f]\n", y[0], y[1], y[2]);
   exit(0); return(0);
}

like look at her go. x walked in with 1.0, 2.0, 3.0, and y was out here with 4.0, 5.0, 6.0, and then boom β€” HPL_dcopy said "not anymore" and now y is serving x's whole look. πŸ”₯


πŸ’œ SEE ALSO πŸ’œ

if you liked this one (and how could you not), go check out her friends:

  • HPL_daxpy (3)
  • HPL_dscal (3)
  • HPL_dswap (3)

ngl bestie, the one thing to remember: INCX and INCY are never allowed to be zero, and N is never allowed to be negative. those are the rules. respect them. 🫢

and that's the whole page!! this was HPL 2.2, dated February 24, 2016, and it lives in the HPL_dcopy(3) manual. mwah, love u, go copy some vectors πŸ’–πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from