HPL_dlacpy(3)

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

πŸ’– HPL_dlacpy β€” a lil function from the HPL Library Functions crew πŸ’–

okay bestie, gather round, because today we're talking about HPL_dlacpy from the HPL Library Functions lineup. it's giving "copy that, but make it linear algebra" and honestly? we're obsessed. πŸ¦‹


✨ NAME ✨

HPL_dlacpy β€” literally just B := A. that's the whole vibe. copy one array into another, no notes. πŸ’…


🌸 SYNOPSIS 🌸

#include "hpl.h"

void HPL_dlacpy( const int M, const int N, const double * A, const int
LDA, double * B, const int LDB );

like yes, six arguments, but she's worth it. πŸ‘‘


πŸŽ€ DESCRIPTION πŸŽ€

so what does she actually do? HPL_dlacpy copies an array A into an array B. that's it, that's the plot. main character behaviour: takes the data from A, drops it into B, no drama, no returns, no questions asked. 🫢


πŸ’œ ARGUMENTS πŸ’œ

  • M (local input) const int β€” on entry, M says how many rows the arrays A and B have. and listen, M must be at least zero, no negative row counts in this house. 😭
  • N (local input) const int β€” on entry, N says how many columns the arrays A and B have. same rule, bestie: N must be at least zero. ⭐
  • A (local input) const double * β€” on entry, A points to an array of dimension (LDA,N). she's the source, the blueprint, the moment. 🌸
  • LDA (local input) const int β€” on entry, LDA is the leading dimension of the array A. and LDA must be at least MAX(1,M). don't test her. πŸ™ˆ
  • B (local output) double * β€” on entry, B points to an array of dimension (LDB,N). on exit, B is overwritten with A. so like… bye bye old B, hello glow-up. πŸ’–
  • LDB (local input) const int β€” on entry, LDB is the leading dimension of the array B. LDB must be at least MAX(1,M) β€” same energy as LDA, fr fr. πŸ”₯

🌈 EXAMPLE 🌈

here's a lil demo so you can see her in action, no cap:

#include "hpl.h"

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

she ate and left absolutely no crumbs. πŸ“


πŸ¦‹ SEE ALSO πŸ¦‹

  • HPL_dlatcpy (3) β€” her cousin, also iconic, go say hi. ✨

lowkey reminder: LDA and LDB both gotta be at least MAX(1,M) and M and N both gotta be at least zero. she's chill but she's not that chill. πŸ’€

and that's the whole page, bestie!! this one's from HPL 2.2, dated February 24, 2016 β€” oldie but a goodie, and yes she still serves. mwah πŸ’…πŸ’–πŸ§š

πŸ“¦ where this page comes from