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 theINTEGERarray, dimension(4). on entry it's the seed of the random number generator, and the rules are strict, bestie: the array elements must be between0and4095, andISEED(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β anINTEGER, 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β aREALarray, 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 at128or under, and don't forgetISEED(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
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms