Trait DispersionParameter

Source
pub trait DispersionParameter: Copy {
    // Required methods
    fn get_standard_dev(&self) -> f64;
    fn get_variance(&self) -> f64;
    fn get_log_standard_dev(&self) -> f64;
    fn get_modular_standard_dev(&self, log2_modulus: u32) -> f64;
    fn get_modular_variance(&self, log2_modulus: u32) -> f64;
    fn get_modular_log_standard_dev(&self, log2_modulus: u32) -> f64;
}
Expand description

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

Required Methods§

Source

fn get_standard_dev(&self) -> f64

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

Source

fn get_variance(&self) -> f64

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

Source

fn get_log_standard_dev(&self) -> f64

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

Source

fn get_modular_standard_dev(&self, log2_modulus: u32) -> f64

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

Source

fn get_modular_variance(&self, log2_modulus: u32) -> f64

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

Source

fn get_modular_log_standard_dev(&self, log2_modulus: u32) -> f64

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§