[][src]Struct midas_rs::MidasR

pub struct MidasR { /* fields omitted */ }

Methods

impl MidasR[src]

pub fn new(
    MidasRParams { rows: rows, buckets: buckets, m_value: m_value, alpha: alpha }: MidasRParams
) -> Self
[src]

pub fn current_time(&self) -> Int[src]

pub fn alpha(&self) -> Float[src]

Factor used to to decay current values when our inputs signal that time has ticked ahead.

pub fn insert(&mut self, (source, dest, time): (Int, Int, Int)) -> Float[src]

Panics

If time < self.current_time()

pub fn query(&self, source: Int, dest: Int) -> Float[src]

pub fn iterate(
    data: impl Iterator<Item = (Int, Int, Int)>,
    params: MidasRParams
) -> impl Iterator<Item = Float>
[src]

Takes an iterator of (source, dest, time) thruples and returns an iterator of corresponding scores.

For a more ergonomic version, see MidasIterator::midas_r.

Panics

Subsequent iterator will panic if ever passed a thruple where the third element (the time) decreases from its predecessor.

Auto Trait Implementations

impl RefUnwindSafe for MidasR

impl Send for MidasR

impl Sync for MidasR

impl Unpin for MidasR

impl UnwindSafe for MidasR

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> From<T> for T[src]

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

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>,