[][src]Struct goko::plugins::gaussians::DiagGaussian

pub struct DiagGaussian {
    pub moment1: Vec<f32>,
    pub moment2: Vec<f32>,
    pub count: usize,
}

Node component, coded in such a way that it can be efficiently, recursively computed.

Fields

moment1: Vec<f32>

First Moment

moment2: Vec<f32>

Second Moment

count: usize

Cover count, divide the first moment by this to get the mean.

Implementations

impl DiagGaussian[src]

pub fn new(dim: usize) -> DiagGaussian[src]

Creates a new empty diagonal gaussian

pub fn dim(&self) -> usize[src]

Dimension for this

pub fn add_point<T: PointRef>(&mut self, point: &T)[src]

adds a point to the Diagonal Gaussian

pub fn remove_point<T: PointRef>(&mut self, point: &T)[src]

removes a point from the Diagonal Gaussian

pub fn merge(&mut self, other: &DiagGaussian)[src]

Merges two diagonal gaussians together

pub fn mean(&self) -> Vec<f32>[src]

Mean: moment1/count

pub fn var(&self) -> Vec<f32>[src]

Variance: moment2/count - (moment1/count)^2

pub fn count(&self) -> usize[src]

The count used in the above equations

Trait Implementations

impl Clone for DiagGaussian[src]

impl ContinousDistribution for DiagGaussian[src]

impl Debug for DiagGaussian[src]

impl Default for DiagGaussian[src]

impl<D: PointCloud> NodePlugin<D> for DiagGaussian[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> From<T> for T[src]

impl<T> FromCast<T> for T

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,