HPL_dlacpy(3)
π 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,Msays how many rows the arraysAandBhave. and listen,Mmust be at least zero, no negative row counts in this house. πN(local input)const intβ on entry,Nsays how many columns the arraysAandBhave. same rule, bestie:Nmust be at least zero. βA(local input)const double *β on entry,Apoints to an array of dimension(LDA,N). she's the source, the blueprint, the moment. πΈLDA(local input)const intβ on entry,LDAis the leading dimension of the arrayA. andLDAmust be at leastMAX(1,M). don't test her. πB(local output)double *β on entry,Bpoints to an array of dimension(LDB,N). on exit,Bis overwritten withA. so likeβ¦ bye bye old B, hello glow-up. πLDB(local input)const intβ on entry,LDBis the leading dimension of the arrayB.LDBmust be at leastMAX(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:LDAandLDBboth gotta be at leastMAX(1,M)andMandNboth 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
- 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