HPL_setran(3)

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

πŸ’– HPL_setran β€” bestie edition πŸ’–

okay so this is HPL_setran(3), a lil function from the HPL Library Functions crew, and its whole job is babysitting the random number generator. yes queen, the RNG has a manager. πŸ’…


✨ NAME ✨

HPL_setran β€” manage the random number generator. that's it, that's the gig. πŸŽ€


🌸 SYNOPSIS 🌸

#include "hpl.h"

void HPL_setran( const int OPTION, int * IRAN );

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, HPL_setran initializes the random generator with the encoding of the first number X(0) in the sequence, plus the constants a and c that get used to compute the next element in the sequence:

X(n+1) = a*X(n) + c

and where do X(0), a and c live? in the static variables irand, ias and ics. iconic little trio. πŸ‘‘

here's the tea on OPTION, fr fr:

  • when OPTION is 0 (resp. 1 and 2), irand (resp. ia and ic) is set to the values of the input array IRAN.
  • when OPTION is 3, IRAN is set to the current value of irand, and irand is then incremented.

that's the whole vibe check. ✨


πŸ’œ ARGUMENTS πŸ’œ

  • OPTION β€” (local input) const int β€” on entry, OPTION is an integer that specifies the operations to be performed on the random generator as specified above. you tell it what to do, it does the thing. no cap.
  • IRAN β€” (local input/output) int * β€” on entry, IRAN is an array of dimension 2, that contains the 16-lower and 15-higher bits of a random number. yes, dimension 2. two slots. that's the whole container bestie. πŸ“

🌈 SEE ALSO 🌈

  • HPL_ladd (3)
  • HPL_lmul (3)
  • HPL_xjumpm (3)
  • HPL_jumpit (3)
  • HPL_rand (3)

not me writing an entire manual page about a random number generator and getting emotionally attached to it 😭 but like, the math is mathing and the vibes are immaculate, so.

HPL 2.2 🌸 February 24, 2016 β€” that's the version and the date, bestie, this page has been serving since 2016 and it still eats. mwah. πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from