pub trait DispersionParameter: Copy {
    fn get_standard_dev(&self) -> f64;
    fn get_variance(&self) -> f64;
    fn get_log_standard_dev(&self) -> f64;
    fn get_modular_standard_dev<Uint>(&self) -> f64
    where
        Uint: UnsignedInteger
; fn get_modular_variance<Uint>(&self) -> f64
    where
        Uint: UnsignedInteger
; fn get_modular_log_standard_dev<Uint>(&self) -> f64
    where
        Uint: UnsignedInteger
; }
Available on crate feature shortints and not (crate features booleans and __newer_booleans) only.
Expand description

A trait for types representing distribution parameters, for a given unsigned integer type.

Required Methods

Returns the standard deviation of the distribution, i.e. $\sigma = 2^p$.

Returns the variance of the distribution, i.e. $\sigma^2 = 2^{2p}$.

Returns base 2 logarithm of the standard deviation of the distribution, i.e. $\log_2(\sigma)=p$

For a Uint type representing $\mathbb{Z}/2^q\mathbb{Z}$, we return $2^{q-p}$.

For a Uint type representing $\mathbb{Z}/2^q\mathbb{Z}$, we return $2^{2(q-p)}$.

For a Uint type representing $\mathbb{Z}/2^q\mathbb{Z}$, we return $q-p$.

Implementors