HPL_pipid(3)

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

πŸ’– HPL_pipid β€” the pivot-vector glow-up πŸ’–

okay bestie, you know how HPL lives in the HPL Library Functions cinematic universe? yeah. this is HPL_pipid, and she's here to make your pivot vector make sense. slay. πŸŽ€


✨ NAME ✨

HPL_pipid β€” simplify the pivot vector. that's it, that's the job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

#include "hpl.h"

void HPL_pipid( HPL_T_panel * PANEL, int * K, int * IPID );

πŸ¦‹ DESCRIPTION πŸ¦‹

so HPL_pipid computes an array IPID that holds the source and the final destination of matrix rows, and this all comes from applying N interchanges β€” the kind that get computed by the LU factorization with row partial pivoting. ✨

the vibe of IPID is this: the row with global index IPID(i) should get mapped onto the row with global index IPID(i+1). simple, iconic, no notes. 🫢

now, lowkey, we cannot actually know the length of IPID ahead of time. but bestie, we do know some things:

  • the array is at least 2*N long, because there are N rows to swap and broadcast.
  • the length must be smaller than or equal to 4*N, since every row is swapped with at most a single distinct remote row.

the algorithm that builds IPID goes like this: let IA be the global index of the first row to be swapped. periodt.


πŸ’« the actual algorithm πŸ’«

for every row src = IA + i with i in [0..N) that's getting swapped with row dst, where dst is given by DPIV[i]:

1. is row src the destination of a previous row of the current block? i.e., is there some k odd such that IPID(k) is equal to src?

  • Yes: update this destination with dst. for example, if the pivot array is (0,2)(1,1)(2,5) ... , then when we swap rows 2 and 5, we swap in fact row 0 and 5, i.e., row 0 goes to 5 and not 2 as it was thought so far ... 😭
  • No: add the pair (src,dst) at the end of IPID; row src has not been moved yet. πŸ’…

2. is row dst different from src the destination of a previous row of the current block? i.e., is there some k odd such that IPID(k) is equal to dst?

  • Yes: update IPID(k) with src. for example, if the pivot array is (0,5)(1,1)(2,5) ... , then when we swap rows 2 and 5, we swap in fact row 2 and 0, i.e., row 0 goes to 2 and not 5 as it was thought so far ... πŸ’€
  • No: add the pair (dst,src) at the end of IPID; row dst has not been moved yet. ✨
note bestie: when src is equal to dst, the pair (dst,src) should not be added to IPID, and that's to avoid duplicated entries in this array. no duplicates allowed, it's giving main character only. πŸ‘‘

during the construction of the array IPID, we make sure that the first N entries are such that IPID(k) with k odd is equal to IA+k/2. πŸŽ€

and for k in [0..K/2), the row of global index IPID(2*k) should be mapped onto the row of global index IPID(2*k+1). that's the whole point, iykyk. πŸ’–


🌈 ARGUMENTS 🌈

  • PANEL β€” (local input/output) HPL_T_panel * on entry, PANEL points to the data structure containing the panel information. she's the container, she holds the lore. πŸ“¦
  • K β€” (global output) int * on exit, K specifies the number of entries in IPID. K is at least 2*N, and at most 4*N. (yes, that range again. consistency is hot. πŸ”₯)
  • IPID β€” (global output) int * on entry, IPID is an array of length 4*N. on exit, the first K entries of that array contain the src and final destination resulting from the application of the N interchanges as specified by DPIV. the pairs (src,dst) are contiguously stored and sorted so that IPID(2*i+1) is equal to IA+i with i in [0..N). immaculate. πŸ’…βœ¨

🫢 SEE ALSO 🫢

  • HPL_pdlaswp00N (3)
  • HPL_pdlaswp00T (3)
  • HPL_pdlaswp01N (3)
  • HPL_pdlaswp01T (3)

and that's the whole page bestie, we ate and left absolutely no crumbs πŸ“

HPL 2.2 Β· February 24, 2016 β€” go off, historic release notes, you're iconic πŸ’œπŸŒŸ

πŸ“¦ where this page comes from