SRC/slaruv.f(3)

πŸ’… SRC/slaruv.f β€” from the LAPACK Library Functions Manual, bestie

okay so picture this: you're deep in LAPACK land, you need random numbers, and this little icon comes through. it's slaruv, and yes, it's fr fr doing the most while looking like nothing. let's get into it πŸ’–


✨ SYNOPSIS ✨

functions & subroutines 🫢

subroutine slaruv (iseed, n, x)

slaruv returns a vector of n random real numbers from a uniform distribution. that's the whole vibe. simple. iconic. no cap πŸ’…


🌸 Function/Subroutine Documentation 🌸

subroutine slaruv (integer, dimension( 4 ) iseed, integer n, real, dimension( n ) x)

slaruv returns a vector of n random real numbers from a uniform distribution β€” that's literally the headline, bestie.

πŸŽ€ Purpose πŸŽ€

!> !> SLARUV returns a vector of n random real numbers from a uniform (0,1) !> distribution (n <= 128). !> !> This is an auxiliary routine called by SLARNV and CLARNV. !>

so it hands you numbers in the open interval (0,1), and it's got a hard ceiling: n <= 128. don't push it past that, she's not built for it πŸ™ˆ

also she's a supporting character, not the lead β€” she's an auxiliary routine called by SLARNV and CLARNV. main character energy by proxy, honestly πŸ‘‘


πŸ’œ Parameters πŸ’œ

  • ISEED β€” this is the INTEGER array, dimension (4). on entry it's the seed of the random number generator, and the rules are strict, bestie: the array elements must be between 0 and 4095, and ISEED(4) must be odd. on exit, the seed is updated β€” so she does not stay the same, she grows 😌
!> ISEED is INTEGER array, dimension (4) !> On entry, the seed of the random number generator; the array !> elements must be between 0 and 4095, and ISEED(4) must be !> odd. !> On exit, the seed is updated.
  • N β€” an INTEGER, the number of random numbers to be generated. remember the rule: N <= 128.
!> N is INTEGER !> The number of random numbers to be generated. N <= 128.
  • X β€” a REAL array, dimension (N). this is where the generated random numbers land. she's the output, she's the moment, she's the whole point πŸ“
!> X is REAL array, dimension (N) !> The generated random numbers.

πŸ‘‘ Author πŸ‘‘

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

a whole collective of legends, we love to see it 🌈


πŸ”₯ Further Details πŸ”₯

!> !> This routine uses a multiplicative congruential method with modulus !> 2**48 and multiplier 33952834046453 (see G.S.Fishman, !> 'Multiplicative congruential random number generators with modulus !> 2**b: an exhaustive analysis for b = 32 and a partial analysis for !> b = 48', Math. Comp. 189, pp 331-344, 1990). !> !> 48-bit integers are stored in 4 integer array elements with 12 bits !> per element. Hence the routine is portable across machines with !> integers of 32 bits or more. >

okay so the lore: it's a multiplicative congruential method with modulus 2**48 and multiplier 33952834046453. the receipt is G.S.Fishman, 'Multiplicative congruential random number generators with modulus 2*b: an exhaustive analysis for b = 32 and a partial analysis for b = 48'*, Math. Comp. 189, pp 331-344, 1990. cite your sources, periodt πŸ“š

and here's the cute engineering bit 🧚: those 48-bit integers get stored in 4 integer array elements with 12 bits per element. that's why ISEED is dimension (4), bestie β€” it all connects. the payoff? the routine is portable across machines with integers of 32 bits or more. ate and left no crumbs πŸ’€βœ¨


⭐ Definition ⭐

definition at line 94 of file slaruv.f. go look, i'll wait πŸ¦‹


🌸 Author (the meta one) 🌸

generated automatically by Doxygen for LAPACK from the source code. nobody hand-wrote this one, she was born from a build script πŸŽ€


πŸ’– so yeah β€” seed it right, keep n at 128 or under, and don't forget ISEED(4) has to be odd. that's the vibe check. slay. πŸ’…

LAPACK β€” Version 3.12.0 🌸 that's the tea, bestie β€” the page is SRC/slaruv.f(3), version 3.12.0, mwah πŸ’‹πŸ«Ά

πŸ“¦ where this page comes from