pub struct Series<R: Real, const N: usize> { /* private fields */ }
Expand description

Implements a ring buffer of length N that continuously and efficiently computes useful information such as mean and variance, or the minimum and maximum values.

All operations, except initialization, take time O(1).

The buffer can be accessed using indexing, where rolling[0] is the latest value, rolling[1], is the value inserted before, and so on.

Implementations

Create a new rolling series. All values are initialized to zero.

Inserts a new value into the rolling series.

Returns the mean, or average.

Returns the variance.

Returns the standard derivation.

Returns the latest value.

Returns the latest value, normalized. If the standard derivation is zero, return zero.

Returns the sum of all entries.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts to this type from the input type.

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.