Struct restricted_tuple::Generator
[−]
[src]
pub struct Generator<'a, T: 'a + Clone> { /* fields omitted */ }
Generator for yielding restricted tuple
Methods
impl<'a, T: 'a + Clone> Generator<'a, T>
[src]
fn new(cache: &mut CountingFunctionCache,
sets: &'a Vec<Vec<T>>)
-> Generator<'a, T>
sets: &'a Vec<Vec<T>>)
-> Generator<'a, T>
Creates a generator.
Example
let sets: Vec<Vec<u32>> = vec![vec![10, 20], vec![30, 40]]; let mut cache = CountingFunctionCache::new(); let generator = Generator::new(&mut cache, &sets);
fn generate(&self, length: usize, value: BigUint) -> Vec<T>
Generates a restricted tuple with given length and value.
Panics
Panics when no restricted tuple can be generated. This could happen if the length is smaller than the number of sets, or if there is any empty set in the provided sets, or the provided sets itself is empty.
Trait Implementations
impl<'a, T: Clone + 'a + Clone> Clone for Generator<'a, T>
[src]
fn clone(&self) -> Generator<'a, T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more