Struct concrete_commons::dispersion::StandardDev [−][src]
pub struct StandardDev(pub f64);
Expand description
A distribution parameter that uses the standard deviation as representation.
Example:
use concrete_commons::dispersion::{DispersionParameter, StandardDev};
let params = StandardDev::from_standard_dev(2_f64.powf(-25.));
assert_eq!(params.get_standard_dev(), 2_f64.powf(-25.));
assert_eq!(params.get_log_standard_dev(), -25.);
assert_eq!(params.get_variance(), 2_f64.powf(-25.).powi(2));
assert_eq!(
params.get_modular_standard_dev::<u32>(),
2_f64.powf(32. - 25.)
);
assert_eq!(params.get_modular_log_standard_dev::<u32>(), 32. - 25.);
assert_eq!(
params.get_modular_variance::<u32>(),
2_f64.powf(32. - 25.).powi(2)
);
Tuple Fields
0: f64
Implementations
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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$ Read more
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$.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for StandardDev
impl Send for StandardDev
impl Sync for StandardDev
impl Unpin for StandardDev
impl UnwindSafe for StandardDev
Blanket Implementations
Mutably borrows from an owned value. Read more