Trait SeriesOps

Source
pub trait SeriesOps {
Show 14 methods // Required methods fn apply_axis<U, F>(&self, axis: Axis, f: F) -> Vec<U> where F: FnMut(&[f64]) -> U; fn map<F>(&self, f: F) -> FloatMatrix where F: Fn(f64) -> f64; fn zip<F>(&self, other: &Self, f: F) -> FloatMatrix where F: Fn(f64, f64) -> f64; fn matrix_mul(&self, other: &Self) -> FloatMatrix; fn dot(&self, other: &Self) -> FloatMatrix; fn sum_vertical(&self) -> Vec<f64>; fn sum_horizontal(&self) -> Vec<f64>; fn prod_vertical(&self) -> Vec<f64>; fn prod_horizontal(&self) -> Vec<f64>; fn cumsum_vertical(&self) -> FloatMatrix; fn cumsum_horizontal(&self) -> FloatMatrix; fn count_nan_vertical(&self) -> Vec<usize>; fn count_nan_horizontal(&self) -> Vec<usize>; fn is_nan(&self) -> BoolMatrix;
}
Expand description

“Series-like” helpers that work along a single axis.

All the old methods (sum_*, prod_*, is_nan, …) are exposed through this trait, so nothing needs to stay on an impl Matrix<f64>; just use SeriesOps to make the extension methods available.

Required Methods§

Source

fn apply_axis<U, F>(&self, axis: Axis, f: F) -> Vec<U>
where F: FnMut(&[f64]) -> U,

Generic helper: apply f to every column/row and collect its result in a Vec.

Source

fn map<F>(&self, f: F) -> FloatMatrix
where F: Fn(f64) -> f64,

Source

fn zip<F>(&self, other: &Self, f: F) -> FloatMatrix
where F: Fn(f64, f64) -> f64,

Source

fn matrix_mul(&self, other: &Self) -> FloatMatrix

Source

fn dot(&self, other: &Self) -> FloatMatrix

Source

fn sum_vertical(&self) -> Vec<f64>

Source

fn sum_horizontal(&self) -> Vec<f64>

Source

fn prod_vertical(&self) -> Vec<f64>

Source

fn prod_horizontal(&self) -> Vec<f64>

Source

fn cumsum_vertical(&self) -> FloatMatrix

Source

fn cumsum_horizontal(&self) -> FloatMatrix

Source

fn count_nan_vertical(&self) -> Vec<usize>

Source

fn count_nan_horizontal(&self) -> Vec<usize>

Source

fn is_nan(&self) -> BoolMatrix

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§