pub struct ClosedUnitF64(/* private fields */);Expand description
A finite f64 value in the closed interval [0.0, 1.0].
Used for parameters that represent interpolation weights or trade-offs where the boundary values are valid (e.g., Barnes-Hut theta where 0.0 means “maximum accuracy” and 1.0 means “maximum speed”).
§Construction
use cugraph::params::ClosedUnitF64;
let theta = ClosedUnitF64::new(0.5).unwrap();
assert_eq!(theta.get(), 0.5);
// Boundary values are accepted (closed interval):
assert!(ClosedUnitF64::new(0.0).is_ok());
assert!(ClosedUnitF64::new(1.0).is_ok());Implementations§
Trait Implementations§
Source§impl Clone for ClosedUnitF64
impl Clone for ClosedUnitF64
impl Copy for ClosedUnitF64
Source§impl Debug for ClosedUnitF64
impl Debug for ClosedUnitF64
Source§impl Display for ClosedUnitF64
impl Display for ClosedUnitF64
Source§impl From<ClosedUnitF64> for f64
impl From<ClosedUnitF64> for f64
Source§fn from(val: ClosedUnitF64) -> f64
fn from(val: ClosedUnitF64) -> f64
Converts to this type from the input type.
Source§impl PartialEq for ClosedUnitF64
impl PartialEq for ClosedUnitF64
Source§impl PartialOrd for ClosedUnitF64
impl PartialOrd for ClosedUnitF64
impl StructuralPartialEq for ClosedUnitF64
Auto Trait Implementations§
impl Freeze for ClosedUnitF64
impl RefUnwindSafe for ClosedUnitF64
impl Send for ClosedUnitF64
impl Sync for ClosedUnitF64
impl Unpin for ClosedUnitF64
impl UnsafeUnpin for ClosedUnitF64
impl UnwindSafe for ClosedUnitF64
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