HPL_perm(3)
π NAME π
okay bestie, meet HPL_perm β she takes two index arrays and combines them to generate the permutation. no cap, that's the whole gig. π
β¨ SYNOPSIS β¨
#include "hpl.h"
void HPL_perm( const int N, int * LINDXA, int * LINDXAU, int * IWORK );
π¦ DESCRIPTION π¦
so HPL_perm combines two index arrays and generates the permutation that goes with them. it's giving matchmaker, fr fr. π
step one: she computes the inverse of LINDXA, then combines it with LINDXAU. periodt.
step two: and this is the iconic part β so that the permutation can be done in place, LINDXAU gets overwritten with the sequence of permutation that produces the same result. lowkey a glow-up, highkey necessary.
what we ultimately want is:
U[LINDXAU[i]] := U[LINDXA[i]] for i in [0..N).
after you call this function, that in-place permutation can be performed with:
for i in [0..N) swap U[i] with U[LINDXAU[i]].
literally that's it. main character energy from a tiny little function. π
πΈ ARGUMENTS πΈ
Nβ (global input)const intβ on entry,Nspecifies the length of the arraysLINDXAandLINDXAU.Nshould be at least zero. yes bestie, at least zero, don't be weird about it. πLINDXAβ (global input/output)int *β on entry,LINDXAis an array of dimensionNcontaining the source indexes. on exit,LINDXAcontains the combined index array. she came in as one thing and left as another, we love a transformation arc. β¨LINDXAUβ (global input/output)int *β on entry,LINDXAUis an array of dimensionNcontaining the target indexes. on exit,LINDXAUcontains the sequence of permutation, that should be applied in increasing order to permute the underlying arrayUin place. don't skip the increasing-order part, iykyk. π₯IWORKβ (workspace)int *β on entry,IWORKis a workarray of dimensionN. she's just here to help, no notes. π«Ά
π SEE ALSO π
HPL_plindx1(3)HPL_pdlaswp01N(3)HPL_pdlaswp01T(3)
and that's the whole page, bestie π this one's brought to you by HPL 2.2, dated February 24, 2016 β vintage but still slaying, fr fr. πβ¨
π¦ 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