pub struct Probability<R: RealField>(/* private fields */);Expand description
Probability value [0, 1].
Implementations§
Source§impl<R: RealField> Probability<R>
impl<R: RealField> Probability<R>
Sourcepub fn new(val: R) -> Result<Self, PhysicsError>
pub fn new(val: R) -> Result<Self, PhysicsError>
Creates a new Probability instance.
§Errors
Returns PhysicsError::NormalizationError if val is not in [0, 1].
pub fn new_unchecked(val: R) -> Self
pub fn value(&self) -> R
Trait Implementations§
Source§impl<R: Clone + RealField> Clone for Probability<R>
impl<R: Clone + RealField> Clone for Probability<R>
Source§fn clone(&self) -> Probability<R>
fn clone(&self) -> Probability<R>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<R: Copy + RealField> Copy for Probability<R>
Source§impl<R: RealField> Default for Probability<R>
impl<R: RealField> Default for Probability<R>
Source§impl<R: RealField + Into<f64>> From<Probability<R>> for f64
impl<R: RealField + Into<f64>> From<Probability<R>> for f64
Source§fn from(val: Probability<R>) -> Self
fn from(val: Probability<R>) -> Self
Converts to this type from the input type.
Source§impl<R: PartialEq + RealField> PartialEq for Probability<R>
impl<R: PartialEq + RealField> PartialEq for Probability<R>
Source§fn eq(&self, other: &Probability<R>) -> bool
fn eq(&self, other: &Probability<R>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<R: PartialOrd + RealField> PartialOrd for Probability<R>
impl<R: PartialOrd + RealField> PartialOrd for Probability<R>
impl<R: RealField> StructuralPartialEq for Probability<R>
Auto Trait Implementations§
impl<R> Freeze for Probability<R>where
R: Freeze,
impl<R> RefUnwindSafe for Probability<R>where
R: RefUnwindSafe,
impl<R> Send for Probability<R>where
R: Send,
impl<R> Sync for Probability<R>where
R: Sync,
impl<R> Unpin for Probability<R>where
R: Unpin,
impl<R> UnsafeUnpin for Probability<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Probability<R>where
R: UnwindSafe,
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