pub struct NormalConfig {
pub mean: f64,
pub std_dev: f64,
}Expand description
Configuration for the Normal distribution.
§Fields
mean- The mean (location parameter)std_dev- The standard deviation (scale parameter, must be positive)
§Examples
use rs_stats::distributions::normal_distribution::NormalConfig;
let config = NormalConfig { mean: 0.0, std_dev: 1.0 };
assert!(config.std_dev > 0.0);Fields§
§mean: f64The mean (μ) of the distribution.
std_dev: f64The standard deviation (σ) of the distribution.
Implementations§
Source§impl NormalConfig
impl NormalConfig
Sourcepub fn new(mean: f64, std_dev: f64) -> Option<Self>
pub fn new(mean: f64, std_dev: f64) -> Option<Self>
Creates a new NormalConfig with validation
§Arguments
mean- The mean of the distributionstd_dev- The standard deviation of the distribution
§Returns
Some(NormalConfig) if parameters are valid, None otherwise
§Examples
use rs_stats::distributions::normal_distribution::NormalConfig;
let standard_normal = NormalConfig::new(0.0, 1.0);
assert!(standard_normal.is_some());
let invalid_config = NormalConfig::new(0.0, -1.0);
assert!(invalid_config.is_none());Trait Implementations§
Source§impl Clone for NormalConfig
impl Clone for NormalConfig
Source§fn clone(&self) -> NormalConfig
fn clone(&self) -> NormalConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NormalConfig
impl Debug for NormalConfig
Source§impl<'de> Deserialize<'de> for NormalConfig
impl<'de> Deserialize<'de> for NormalConfig
Source§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
Source§impl Serialize for NormalConfig
impl Serialize for NormalConfig
impl Copy for NormalConfig
Auto Trait Implementations§
impl Freeze for NormalConfig
impl RefUnwindSafe for NormalConfig
impl Send for NormalConfig
impl Sync for NormalConfig
impl Unpin for NormalConfig
impl UnwindSafe for NormalConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more