pub struct JointProbability<T> {
pub matrix: Vec<Vec<T>>,
}Expand description
A collection type wrapper containing a two-dimensional grid layout of raw statistical densities.
Fields§
§matrix: Vec<Vec<T>>Implementations§
Source§impl JointProbability<f64>
impl JointProbability<f64>
Sourcepub fn new(px: Vec<Vec<f64>>) -> Self
pub fn new(px: Vec<Vec<f64>>) -> Self
Constructs an instance around a raw joint metric distribution table matrix.
§Example
let matrix = vec![vec![0.2, 0.3], vec![0.1, 0.4]];
let joint_prob = JointProbability::new(matrix);Sourcepub fn validate_probability(&self)
pub fn validate_probability(&self)
Accumulates and sums every item in the grid rows to check if the combined weights total 1.0.
Trait Implementations§
Source§impl<T: Debug> Debug for JointProbability<T>
impl<T: Debug> Debug for JointProbability<T>
Source§impl<T: PartialEq> PartialEq for JointProbability<T>
impl<T: PartialEq> PartialEq for JointProbability<T>
impl<T> StructuralPartialEq for JointProbability<T>
Auto Trait Implementations§
impl<T> Freeze for JointProbability<T>
impl<T> RefUnwindSafe for JointProbability<T>where
T: RefUnwindSafe,
impl<T> Send for JointProbability<T>where
T: Send,
impl<T> Sync for JointProbability<T>where
T: Sync,
impl<T> Unpin for JointProbability<T>where
T: Unpin,
impl<T> UnwindSafe for JointProbability<T>where
T: 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