struct Source
XuAPI
pub struct Source {
pub state int
}Purpose
Public struct `Source`.
Parameters
stateint- field (int)
API
#math/randSource instances. No global source. xorshift64*; intn uses rejection sampling.
struct Sourcepub struct Source {
pub state int
}Public struct `Source`.
state intnew_sourcepub fn new_source(seed int) SourceConstruct source.
seed intSource — a value of this type
(&mut Source) seedpub fn (s &mut Source) seed(seed int)Call `seed` on `&mut Source`.
s &mut Sourceseed int(&mut Source) int63pub fn (s &mut Source) int63() intCall `int63` on `&mut Source`.
s &mut Sourceint — a value of this type
(&mut Source) intnpub fn (s &mut Source) intn(n int) intCall `intn` on `&mut Source`.
s &mut Sourcen intint — a value of this type
(&mut Source) float64pub fn (s &mut Source) float64() f64Call `float64` on `&mut Source`.
s &mut Sourcef64 — a value of this type
(&mut Source) int31pub fn (s &mut Source) int31() intCall `int31` on `&mut Source`.
s &mut Sourceint — a value of this type
(&mut Source) permpub fn (s &mut Source) perm(n int) []intMethod on `&mut Source`: permutation.
s &mut Sourcen int[]int — slice result
(&mut Source) shufflepub fn (s &mut Source) shuffle(a &mut []int)Method on `&mut Source`: shuffle.
s &mut Sourcea &mut []int