pub fn next(&mut self, rng : &mut Xoshiro256PlusPlus) -> usize {
        if self.lastidx >= self.m {
            self.reset();
        }
        let xsi = self.unif_01.sample(rng);
        // sample between self.lastidx (included) and self.m (excluded)
        let idx = self.lastidx + (xsi * (self.m - self.lastidx) as f64) as usize;
        let val = self.v[idx];
        self.v[idx] = self.v[self.lastidx];
        self.v[self.lastidx] = val;
        self.lastidx += 1;
        val
    }
/// generates next randomly choosen item of the set (you get sampling without replacement)
/// After being call m times, it is possible to get the full permutation with the function get_values
/// as the permutation is fully sampled.
/// If called more than m times, it calls reset implicitly to generate a new permutation.
/// It is possible (and recommended) to reset explicitly after m successive call to next method
generates next randomly choosen item of the set (you get sampling without replacement)
After being call m times, it is possible to get the full permutation with the function get_values
as the permutation is fully sampled.
If called more than m times, it calls reset implicitly to generate a new permutation.
It is possible (and recommended) to reset explicitly after m successive call to next method
generates next randomly choosen item of the set ( you get sampling without replacement ) After being call m times it is possible to get the full permutation with the function get_values as the permutation is fully sampled . If called more than m times it calls reset implicitly to generate a new permutation . It is possible ( and recommended ) to reset explicitly after m successive call to next method
pub fn next(&mut self, rng : &mut Xoshiro256PlusPlus) -> usize {
        if self.lastidx >= self.m {
            self.reset();
        }
        let xsi = self.unif_01.sample(rng);
        // sample between self.lastidx (included) and self.m (excluded)
        let idx = self.lastidx + (xsi * (self.m - self.lastidx) as f64) as usize;
        let val = self.v[idx];
        self.v[idx] = self.v[self.lastidx];
        self.v[self.lastidx] = val;
        self.lastidx += 1;
        val
    }
pub fn next ( & mut self , rng : & mut Xoshiro256PlusPlus ) -> usize { if self . lastidx >= self . m { self . reset ( ) ; } let xsi = self . unif_01 . sample ( rng ) ; // sample between self.lastidx (included) and self.m (excluded) let idx = self . lastidx + ( xsi * ( self . m - self . lastidx ) as f64 ) as usize ; let val = self . v [ idx ] ; self . v [ idx ] = self . v [ self . lastidx ] ; self . v [ self . lastidx ] = val ; self . lastidx += 1 ; val }
generates next randomly choosen item of the set (you get sampling without replacement)
After being call m times, it is possible to get the full permutation with the function get_values
as the permutation is fully sampled.
generates next randomly choosen item of the set ( you get sampling without replacement ) After being call m times it is possible to get the full permutation with the function get_values as the permutation is fully sampled .
&mut self
rng
&mut Xoshiro256PlusPlus