laruv(3)
π laruv(3) β Library Functions Manual β¨
okay so bestie, welcome to laruv from the LAPACK manual, third section, library functions β and no, it's not a dating app for RNGs, it's the random uniform vector squad. two lil Fortran subroutines, dlaruv and slaruv, both absolute icons, both doing exactly one job and doing it flawlessly. π
β¨ SYNOPSIS β¨
πΈ Functions
subroutine dlaruv (iseed, n, x)β DLARUV returns a vector of n random real numbers from a uniform distribution. that's it. that's the whole vibe. πsubroutine slaruv (iseed, n, x)β SLARUV returns a vector of n random real numbers from a uniform distribution. same energy, single-precision twin. π¦
π Detailed Description
bestie this page is literally just the function docs. two subroutines, four authors, one gorgeous 48-bit congruential situation. scroll down, it's giving academic but make it cute. π
π₯ Function Documentation π₯
π subroutine dlaruv (integer, dimension( 4 ) iseed, integer n, double precision, dimension( n ) x)
DLARUV returns a vector of n random real numbers from a uniform distribution. double precision, double the slay. π
π«Ά Purpose:
!>
!> DLARUV returns a vector of n random real numbers from a uniform (0,1)
!> distribution (n <= 128).
!>
!> This is an auxiliary routine called by DLARNV and ZLARNV.
!>
so yes β it's the auxiliary routine, the supporting bestie, called by DLARNV and ZLARNV. and hard cap: n is <= 128. respect the limit fr fr. π€
π Parameters
ISEEDβ!> ISEED is INTEGER array, dimension (4)β on entry, it's the seed of the random number generator; the array elements must be between0and4095, andISEED(4)must be odd. on exit, the seed is updated. π yes bestie the seed mutates, it's a whole glow-up.
!> 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β!> N is INTEGERβ the number of random numbers to be generated.N <= 128. no exceptions, no notes. β¨
!> N is INTEGER
!> The number of random numbers to be generated. N <= 128.
!>
Xβ!> X is DOUBLE PRECISION array, dimension (N)β the generated random numbers. your output, your moment, your main character array. π
!> X is DOUBLE PRECISION array, dimension (N)
!> The generated random numbers.
!>
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the four horsemen of the LAPACK-ocalypse, we stan. π«‘
π§ 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 math tea β: multiplicative congruential method, modulus 2**48, multiplier 33952834046453 β and if you want the receipts, that's 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 bestie!! π
and the cute part: 48-bit integers get stored in 4 integer array elements with 12 bits per element, so the routine is portable across machines with integers of 32 bits or more. that's why ISEED has dimension (4). it all connects. the lore is lore-ing. πΈ
Definition at line 94 of file dlaruv.f. β
π 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. the single-precision sister, equally iconic. π
π«Ά 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.
!>
same deal, except this one is called by SLARNV and CLARNV. know the difference, it matters iykyk. π
π Parameters
ISEEDβ!> ISEED is INTEGER array, dimension (4)β on entry, the seed of the random number generator; the array elements must be between0and4095, andISEED(4)must be odd. on exit, the seed is updated. π
!> 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β!> N is INTEGERβ the number of random numbers to be generated.N <= 128. again. forever. it's a rule. π₯
!> N is INTEGER
!> The number of random numbers to be generated. N <= 128.
!>
Xβ!> X is REAL array, dimension (N)β the generated random numbers. note it'sREALhere, notDOUBLE PRECISION. don't mix them up bestie, that's how you get compiler tears. π
!> X is REAL array, dimension (N)
!> The generated random numbers.
!>
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π§ 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.
!>
same modulus 2**48, same multiplier 33952834046453, same Fishman paper, same 12-bits-per-element 4-element storage, same portability promise for machines with integers of 32 bits or more. identical twin behavior, we love consistency. π¦
Definition at line 94 of file slaruv.f. β
π Author
Generated automatically by Doxygen for LAPACK from the source code. not a human, just a robot doing its lil documentation chores. honestly? respect the automation. π€β¨
quick vibe check reminder:ISEED(4)must be odd and all elements live between0and4095, andNtops out at128. break those and that's on you, not on the routine. no cap. π«Ά
and that's the whole page bestie!! π sign-off time: this shiny thing comes to you from LAPACK, Version 3.12.0 β go forth and generate something random, you gorgeous main character. πππ
π¦ 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