pub struct PowerFunction { /* private fields */ }Expand description
Power function distribution
§Examples
let mut power_function = rand_simple::PowerFunction::new(1192u32);
assert_eq!(format!("{power_function}"), "PF(Shape parameter γ, Boundary parameter a, Boundary parameter b) = PF(1, 0, 1)");
// If you want to change the parameters of the random variable
let shape: f64 = 2_f64;
let min: f64 = -1_f64;
let max: f64 = 1_f64;
let result: Result<(f64, f64, f64), &str> = power_function.try_set_params(shape, min, max);
assert_eq!(format!("{power_function}"), "PF(Shape parameter γ, Boundary parameter a, Boundary parameter b) = PF(2, -1, 1)");Implementations§
Source§impl PowerFunction
impl PowerFunction
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PowerFunction
impl RefUnwindSafe for PowerFunction
impl Send for PowerFunction
impl Sync for PowerFunction
impl Unpin for PowerFunction
impl UnwindSafe for PowerFunction
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