Struct datagen::relation::ZipfRelation
source · [−]pub struct ZipfRelation;
Expand description
Generator for relations with Zipf distribution.
Implementations
sourceimpl ZipfRelation
impl ZipfRelation
sourcepub fn gen_attr<T: FromPrimitive>(
attr: &mut [T],
num_elements: usize,
exponent: f64
) -> Result<()>
pub fn gen_attr<T: FromPrimitive>(
attr: &mut [T],
num_elements: usize,
exponent: f64
) -> Result<()>
Generates an attribute following the Zipf distribution.
The generated values are sampled from 1 to num_elements (inclusive). Note that the exponent must be greather than 0.
In the literature, num_elements is also called the alphabet size.
sourcepub fn gen_attr_par<T: FromPrimitive + Send>(
attr: &mut [T],
num_elements: usize,
exponent: f64
) -> Result<()>
pub fn gen_attr_par<T: FromPrimitive + Send>(
attr: &mut [T],
num_elements: usize,
exponent: f64
) -> Result<()>
Generates an attribute following the Zipf distribution in parallel.
The generated values are sampled from 0 to num_elements (exclusive). Note that the exponent must be greather than 0.
In the literature, num_elements is also called the alphabet size.
Auto Trait Implementations
impl RefUnwindSafe for ZipfRelation
impl Send for ZipfRelation
impl Sync for ZipfRelation
impl Unpin for ZipfRelation
impl UnwindSafe for ZipfRelation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more