pub struct NonNegativeF64(/* private fields */);Expand description
A non-negative, finite f64 value (i.e., >= 0.0).
Used for parameters that may be zero but not negative, such as
edge_weight_influence (where 0.0 means “no influence”).
§Construction
use cugraph::params::NonNegativeF64;
let influence = NonNegativeF64::new(0.0).unwrap();
assert_eq!(influence.get(), 0.0);
let influence = NonNegativeF64::new(1.5).unwrap();
assert_eq!(influence.get(), 1.5);
// Negative values are rejected:
assert!(NonNegativeF64::new(-0.1).is_err());Implementations§
Trait Implementations§
Source§impl Clone for NonNegativeF64
impl Clone for NonNegativeF64
impl Copy for NonNegativeF64
Source§impl Debug for NonNegativeF64
impl Debug for NonNegativeF64
Source§impl Display for NonNegativeF64
impl Display for NonNegativeF64
Source§impl From<NonNegativeF64> for f64
impl From<NonNegativeF64> for f64
Source§fn from(val: NonNegativeF64) -> f64
fn from(val: NonNegativeF64) -> f64
Converts to this type from the input type.
Source§impl PartialEq for NonNegativeF64
impl PartialEq for NonNegativeF64
Source§impl PartialOrd for NonNegativeF64
impl PartialOrd for NonNegativeF64
impl StructuralPartialEq for NonNegativeF64
Auto Trait Implementations§
impl Freeze for NonNegativeF64
impl RefUnwindSafe for NonNegativeF64
impl Send for NonNegativeF64
impl Sync for NonNegativeF64
impl Unpin for NonNegativeF64
impl UnsafeUnpin for NonNegativeF64
impl UnwindSafe for NonNegativeF64
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