pub struct UnitF64(/* private fields */);Expand description
A finite f64 value in the open interval (0.0, 1.0).
Used for parameters that represent fractions or probabilities, such as the
PageRank damping factor (alpha) and Barnes-Hut trade-off (theta).
§Construction
use cugraph::params::UnitF64;
let alpha = UnitF64::new(0.85).unwrap();
assert_eq!(alpha.get(), 0.85);
// Boundary values are rejected (open interval):
assert!(UnitF64::new(0.0).is_err());
assert!(UnitF64::new(1.0).is_err());Implementations§
Trait Implementations§
impl Copy for UnitF64
Source§impl PartialOrd for UnitF64
impl PartialOrd for UnitF64
impl StructuralPartialEq for UnitF64
Auto Trait Implementations§
impl Freeze for UnitF64
impl RefUnwindSafe for UnitF64
impl Send for UnitF64
impl Sync for UnitF64
impl Unpin for UnitF64
impl UnsafeUnpin for UnitF64
impl UnwindSafe for UnitF64
Blanket Implementations§
impl<T> Allocation for T
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