Struct rand_simple::LogLaplace
source · pub struct LogLaplace { /* private fields */ }Expand description
Log-Laplace Distribution
Example
let mut log_laplace = rand_simple::LogLaplace::new(1192u32);
assert_eq!(format!("{log_laplace}"), "LLa(Location parameter, Scale parameter) = LLa(0, 1)");
println!("Returns a random number -> {}", log_laplace.sample());
// Modify the distribution's parameters
let location: f64 = -2f64;
let scale: f64 = 1.5f64;
let result: Result<(f64, f64), &str> = log_laplace.try_set_params(location, scale);
assert_eq!(format!("{log_laplace}"), "LLa(Location parameter, Scale parameter) = LLa(-2, 1.5)");
println!("Returns a random number -> {}", log_laplace.sample());Implementations§
source§impl LogLaplace
impl LogLaplace
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for LogLaplace
impl Send for LogLaplace
impl Sync for LogLaplace
impl Unpin for LogLaplace
impl UnwindSafe for LogLaplace
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