var searchIndex = {}; searchIndex["rand"] = {"doc":"Utilities for random number generation","items":[[3,"Generator","rand","Iterator which will generate a stream of random items.",null,null],[3,"AsciiGenerator","","Iterator which will continuously generate random ascii characters.",null,null],[3,"XorShiftRng","","An Xorshift[1] random number\ngenerator.",null,null],[3,"Open01","","A wrapper for generating floating point numbers uniformly in the\nopen interval `(0,1)` (not including either endpoint).",null,null],[12,"0","","",0,null],[3,"Closed01","","A wrapper for generating floating point numbers uniformly in the\nclosed interval `[0,1]` (including both endpoints).",null,null],[12,"0","","",1,null],[3,"StdRng","","The standard RNG. This is designed to be efficient on the current\nplatform.",null,null],[3,"ThreadRng","","The thread-local RNG.",null,null],[5,"weak_rng","","Create a weak random number generator with a default algorithm and seed.",null,{"inputs":[],"output":{"name":"xorshiftrng"}}],[5,"thread_rng","","Retrieve the lazily-initialized thread-local random number\ngenerator, seeded by the system. Intended to be used in method\nchaining style, e.g. `thread_rng().gen::<i32>()`.",null,{"inputs":[],"output":{"name":"threadrng"}}],[5,"random","","Generates a random value using the thread-local random number generator.",null,{"inputs":[],"output":{"name":"t"}}],[5,"sample","","Randomly sample up to `amount` elements from an iterator.",null,{"inputs":[{"name":"r"},{"name":"i"},{"name":"usize"}],"output":{"name":"vec"}}],[0,"distributions","","Sampling from random distributions.",null,null],[3,"RandSample","rand::distributions","A wrapper for generating types that implement `Rand` via the\n`Sample` & `IndependentSample` traits.",null,null],[3,"Weighted","","A value with a particular weight for use with `WeightedChoice`.",null,null],[12,"weight","","The numerical weight of this item",2,null],[12,"item","","The actual item which is being weighted",2,null],[3,"WeightedChoice","","A distribution that selects from a finite collection of weighted items.",null,null],[0,"range","","Generating numbers between two others.",null,null],[3,"Range","rand::distributions::range","Sample values uniformly between two bounds.",null,null],[8,"SampleRange","","The helper trait for types that have a sensible way to sample\nuniformly between two values. This should not be used directly,\nand is only to facilitate `Range`.",null,null],[10,"construct_range","","Construct the `Range` object that `sample_range`\nrequires. This should not ever be called directly, only via\n`Range::new`, which will check that `low < high`, so this\nfunction doesn't have to repeat the check.",3,{"inputs":[{"name":"self"},{"name":"self"}],"output":{"name":"range"}}],[10,"sample_range","","Sample a value from the given `Range` with the given `Rng` as\na source of randomness.",3,{"inputs":[{"name":"range"},{"name":"r"}],"output":{"name":"self"}}],[11,"clone","","",4,null],[11,"new","","Create a new `Range` instance that samples uniformly from\n`[low, high)`. Panics if `low >= high`.",4,{"inputs":[{"name":"x"},{"name":"x"}],"output":{"name":"range"}}],[11,"sample","","",4,null],[11,"ind_sample","","",4,null],[0,"gamma","rand::distributions","The Gamma and derived distributions.",null,null],[3,"Gamma","rand::distributions::gamma","The Gamma distribution `Gamma(shape, scale)` distribution.",null,null],[3,"ChiSquared","","The chi-squared distribution `χ²(k)`, where `k` is the degrees of\nfreedom.",null,null],[3,"FisherF","","The Fisher F distribution `F(m, n)`.",null,null],[3,"StudentT","","The Student t distribution, `t(nu)`, where `nu` is the degrees of\nfreedom.",null,null],[11,"clone","","",5,null],[11,"new","","Construct an object representing the `Gamma(shape, scale)`\ndistribution.",5,{"inputs":[{"name":"f64"},{"name":"f64"}],"output":{"name":"gamma"}}],[11,"sample","","",5,null],[11,"ind_sample","","",5,null],[11,"clone","","",6,null],[11,"new","","Create a new chi-squared distribution with degrees-of-freedom\n`k`. Panics if `k < 0`.",6,{"inputs":[{"name":"f64"}],"output":{"name":"chisquared"}}],[11,"sample","","",6,null],[11,"ind_sample","","",6,null],[11,"clone","","",7,null],[11,"new","","Create a new `FisherF` distribution, with the given\nparameter. Panics if either `m` or `n` are not positive.",7,{"inputs":[{"name":"f64"},{"name":"f64"}],"output":{"name":"fisherf"}}],[11,"sample","","",7,null],[11,"ind_sample","","",7,null],[11,"clone","","",8,null],[11,"new","","Create a new Student t distribution with `n` degrees of\nfreedom. Panics if `n <= 0`.",8,{"inputs":[{"name":"f64"}],"output":{"name":"studentt"}}],[11,"sample","","",8,null],[11,"ind_sample","","",8,null],[0,"normal","rand::distributions","The normal and derived distributions.",null,null],[3,"StandardNormal","rand::distributions::normal","A wrapper around an `f64` to generate N(0, 1) random numbers\n(a.k.a. a standard normal, or Gaussian).",null,null],[12,"0","","",9,null],[3,"Normal","","The normal distribution `N(mean, std_dev**2)`.",null,null],[3,"LogNormal","","The log-normal distribution `ln N(mean, std_dev**2)`.",null,null],[11,"clone","","",9,null],[11,"rand","","",9,{"inputs":[{"name":"r"}],"output":{"name":"standardnormal"}}],[11,"clone","","",10,null],[11,"new","","Construct a new `Normal` distribution with the given mean and\nstandard deviation.",10,{"inputs":[{"name":"f64"},{"name":"f64"}],"output":{"name":"normal"}}],[11,"sample","","",10,null],[11,"ind_sample","","",10,null],[11,"clone","","",11,null],[11,"new","","Construct a new `LogNormal` distribution with the given mean\nand standard deviation.",11,{"inputs":[{"name":"f64"},{"name":"f64"}],"output":{"name":"lognormal"}}],[11,"sample","","",11,null],[11,"ind_sample","","",11,null],[0,"exponential","rand::distributions","The exponential distribution.",null,null],[3,"Exp1","rand::distributions::exponential","A wrapper around an `f64` to generate Exp(1) random numbers.",null,null],[12,"0","","",12,null],[3,"Exp","","The exponential distribution `Exp(lambda)`.",null,null],[11,"clone","","",12,null],[11,"rand","","",12,{"inputs":[{"name":"r"}],"output":{"name":"exp1"}}],[11,"clone","","",13,null],[11,"new","","Construct a new `Exp` with the given shape parameter\n`lambda`. Panics if `lambda <= 0`.",13,{"inputs":[{"name":"f64"}],"output":{"name":"exp"}}],[11,"sample","","",13,null],[11,"ind_sample","","",13,null],[8,"Sample","rand::distributions","Types that can be used to create a random instance of `Support`.",null,null],[10,"sample","","Generate a random value of `Support`, using `rng` as the\nsource of randomness.",14,null],[8,"IndependentSample","","`Sample`s that do not require keeping track of state.",null,null],[10,"ind_sample","","Generate a random value.",15,null],[11,"clone","","",16,null],[11,"sample","","",16,null],[11,"ind_sample","","",16,null],[11,"new","","",16,{"inputs":[],"output":{"name":"randsample"}}],[11,"clone","","",2,null],[11,"new","","Create a new `WeightedChoice`.",17,null],[11,"sample","","",17,null],[11,"ind_sample","","",17,null],[0,"isaac","rand","The ISAAC random number generator.",null,null],[3,"IsaacRng","rand::isaac","A random number generator that uses the ISAAC algorithm[1].",null,null],[3,"Isaac64Rng","","A random number generator that uses ISAAC-64[1], the 64-bit\nvariant of the ISAAC algorithm.",null,null],[11,"new_unseeded","","Create an ISAAC random number generator using the default\nfixed seed.",18,{"inputs":[],"output":{"name":"isaacrng"}}],[11,"clone","","",18,null],[11,"next_u32","","",18,null],[11,"reseed","","",18,null],[11,"from_seed","","Create an ISAAC random number generator with a seed. This can\nbe any length, although the maximum number of elements used is\n256 and any more will be silently ignored. A generator\nconstructed with a given seed will generate the same sequence\nof values as all other generators constructed with that seed.",18,null],[11,"rand","","",18,{"inputs":[{"name":"r"}],"output":{"name":"isaacrng"}}],[11,"new_unseeded","","Create a 64-bit ISAAC random number generator using the\ndefault fixed seed.",19,{"inputs":[],"output":{"name":"isaac64rng"}}],[11,"clone","","",19,null],[11,"next_u32","","",19,null],[11,"next_u64","","",19,null],[11,"reseed","","",19,null],[11,"from_seed","","Create an ISAAC random number generator with a seed. This can\nbe any length, although the maximum number of elements used is\n256 and any more will be silently ignored. A generator\nconstructed with a given seed will generate the same sequence\nof values as all other generators constructed with that seed.",19,null],[11,"rand","","",19,{"inputs":[{"name":"r"}],"output":{"name":"isaac64rng"}}],[0,"chacha","rand","The ChaCha random number generator.",null,null],[3,"ChaChaRng","rand::chacha","A random number generator that uses the ChaCha20 algorithm [1].",null,null],[11,"clone","","",20,null],[11,"new_unseeded","","Create an ChaCha random number generator using the default\nfixed key of 8 zero words.",20,{"inputs":[],"output":{"name":"chacharng"}}],[11,"set_counter","","Sets the internal 128-bit ChaCha counter to\na user-provided value. This permits jumping\narbitrarily ahead (or backwards) in the pseudorandom stream.",20,null],[11,"next_u32","","",20,null],[11,"reseed","","",20,null],[11,"from_seed","","Create a ChaCha generator from a seed,\nobtained from a variable-length u32 array.\nOnly up to 8 words are used; if less than 8\nwords are used, the remaining are set to zero.",20,null],[11,"rand","","",20,{"inputs":[{"name":"r"}],"output":{"name":"chacharng"}}],[0,"reseeding","rand","A wrapper around another RNG that reseeds it after it\ngenerates a certain number of random bytes.",null,null],[3,"ReseedingRng","rand::reseeding","A wrapper around any RNG which reseeds the underlying RNG after it\nhas generated a certain number of random bytes.",null,null],[12,"reseeder","","Controls the behaviour when reseeding the RNG.",21,null],[3,"ReseedWithDefault","","Reseed an RNG using a `Default` instance. This reseeds by\nreplacing the RNG with the result of a `Default::default` call.",null,null],[8,"Reseeder","","Something that can be used to reseed an RNG via `ReseedingRng`.",null,null],[10,"reseed","","Reseed the given RNG.",22,null],[11,"new","","Create a new `ReseedingRng` with the given parameters.",21,{"inputs":[{"name":"r"},{"name":"u64"},{"name":"rsdr"}],"output":{"name":"reseedingrng"}}],[11,"reseed_if_necessary","","Reseed the internal RNG if the number of bytes that have been\ngenerated exceed the threshold.",21,null],[11,"next_u32","","",21,null],[11,"next_u64","","",21,null],[11,"fill_bytes","","",21,null],[11,"reseed","","",21,null],[11,"from_seed","","Create a new `ReseedingRng` from the given reseeder and\nseed. This uses a default value for `generation_threshold`.",21,null],[11,"clone","","",23,null],[11,"reseed","","",23,null],[11,"default","","",23,{"inputs":[],"output":{"name":"reseedwithdefault"}}],[11,"rand","rand","",0,{"inputs":[{"name":"r"}],"output":{"name":"open01"}}],[11,"rand","","",1,{"inputs":[{"name":"r"}],"output":{"name":"closed01"}}],[11,"rand","","",0,{"inputs":[{"name":"r"}],"output":{"name":"open01"}}],[11,"rand","","",1,{"inputs":[{"name":"r"}],"output":{"name":"closed01"}}],[0,"os","","Interfaces to the operating system provided random number\ngenerators.",null,null],[3,"OsRng","rand::os","A random number generator that retrieves randomness straight from\nthe operating system. Platform sources:",null,null],[11,"new","","Create a new `OsRng`.",24,{"inputs":[],"output":{"name":"result"}}],[11,"next_u32","","",24,null],[11,"next_u64","","",24,null],[11,"fill_bytes","","",24,null],[0,"read","rand","A wrapper around any Read to treat it as an RNG.",null,null],[3,"ReadRng","rand::read","An RNG that reads random bytes straight from a `Read`. This will\nwork best with an infinite reader, but this is not required.",null,null],[11,"new","","Create a new `ReadRng` from a `Read`.",25,{"inputs":[{"name":"r"}],"output":{"name":"readrng"}}],[11,"next_u32","","",25,null],[11,"next_u64","","",25,null],[11,"fill_bytes","","",25,null],[8,"Rand","rand","A type that can be randomly generated using an `Rng`.",null,null],[10,"rand","","Generates a random instance of this type using the specified source of\nrandomness.",26,{"inputs":[{"name":"r"}],"output":{"name":"self"}}],[8,"Rng","","A random number generator.",null,null],[10,"next_u32","","Return the next random u32.",27,null],[11,"next_u64","","Return the next random u64.",27,null],[11,"next_f32","","Return the next random f32 selected from the half-open\ninterval `[0, 1)`.",27,null],[11,"next_f64","","Return the next random f64 selected from the half-open\ninterval `[0, 1)`.",27,null],[11,"fill_bytes","","Fill `dest` with random data.",27,null],[11,"gen","","Return a random value of a `Rand` type.",27,null],[11,"gen_iter","","Return an iterator that will yield an infinite number of randomly\ngenerated items.",27,null],[11,"gen_range","","Generate a random value in the range [`low`, `high`).",27,null],[11,"gen_weighted_bool","","Return a bool with a 1 in n chance of true",27,null],[11,"gen_ascii_chars","","Return an iterator of random characters from the set A-Z,a-z,0-9.",27,null],[11,"choose","","Return a random element from `values`.",27,null],[11,"shuffle","","Shuffle a mutable slice in place.",27,null],[8,"SeedableRng","","A random number generator that can be explicitly seeded to produce\nthe same stream of randomness multiple times.",null,null],[10,"reseed","","Reseed an RNG with the given seed.",28,null],[10,"from_seed","","Create a new RNG with the given seed.",28,{"inputs":[{"name":"seed"}],"output":{"name":"self"}}],[11,"next","","",29,null],[11,"next","","",30,null],[11,"clone","","",31,null],[11,"new_unseeded","","Creates a new XorShiftRng instance which is not seeded.",31,{"inputs":[],"output":{"name":"xorshiftrng"}}],[11,"next_u32","","",31,null],[11,"reseed","","Reseed an XorShiftRng. This will panic if `seed` is entirely 0.",31,null],[11,"from_seed","","Create a new XorShiftRng. This will panic if `seed` is entirely 0.",31,null],[11,"rand","","",31,{"inputs":[{"name":"r"}],"output":{"name":"xorshiftrng"}}],[11,"clone","","",32,null],[11,"new","","Create a randomly seeded instance of `StdRng`.",32,{"inputs":[],"output":{"name":"result"}}],[11,"next_u32","","",32,null],[11,"next_u64","","",32,null],[11,"reseed","","",32,null],[11,"from_seed","","",32,null],[11,"clone","","",33,null],[11,"next_u32","","",33,null],[11,"next_u64","","",33,null],[11,"fill_bytes","","",33,null]],"paths":[[3,"Open01"],[3,"Closed01"],[3,"Weighted"],[8,"SampleRange"],[3,"Range"],[3,"Gamma"],[3,"ChiSquared"],[3,"FisherF"],[3,"StudentT"],[3,"StandardNormal"],[3,"Normal"],[3,"LogNormal"],[3,"Exp1"],[3,"Exp"],[8,"Sample"],[8,"IndependentSample"],[3,"RandSample"],[3,"WeightedChoice"],[3,"IsaacRng"],[3,"Isaac64Rng"],[3,"ChaChaRng"],[3,"ReseedingRng"],[8,"Reseeder"],[3,"ReseedWithDefault"],[3,"OsRng"],[3,"ReadRng"],[8,"Rand"],[8,"Rng"],[8,"SeedableRng"],[3,"Generator"],[3,"AsciiGenerator"],[3,"XorShiftRng"],[3,"StdRng"],[3,"ThreadRng"]]}; initSearch(searchIndex);