Struct Merger

Source
pub struct Merger {
    pub series: TimeSeries,
    pub data: Vec<(f64, f64)>,
    /* private fields */
}
Expand description

Merges multiple time series into one, but can only merge time series of the same length or the same multiple. the point is: it will always yield complete seasons if you use a season on the as_time_series method with the same length as the base. Once time series have been merged they can only be separated using season, but this doesnt affect the merger. but don’t worry, merger only uses clones ;)

If you just need to append data to an existing time series then used the push func in the time series, you dumb thing.

Fields§

§series: TimeSeries§data: Vec<(f64, f64)>

Implementations§

Source§

impl Merger

Source

pub fn new(base: &TimeSeries) -> Self

Creates a new Merger using a timeseries as a base, or first season

Source

pub fn merge_with(self, series: &TimeSeries) -> Self

Source

pub fn merge_len(&self) -> usize

Returns the lenght that any time series to merge must have (the base length)

Source

pub fn len(&self) -> usize

Returns the total length of the timeseries merged

Source

pub fn as_time_series(&self) -> TimeSeries

Auto Trait Implementations§

§

impl Freeze for Merger

§

impl RefUnwindSafe for Merger

§

impl Send for Merger

§

impl Sync for Merger

§

impl Unpin for Merger

§

impl UnwindSafe for Merger

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.