Trait basic_dsp::StatisticsSplitOps

source ·
pub trait StatisticsSplitOps<T> {
    type Result;

    // Required method
    fn statistics_split(&self, len: usize) -> Result<Self::Result, ErrorReason>;
}
Expand description

This trait offers operations to calculate statistics about the data in a type.

Required Associated Types§

Required Methods§

source

fn statistics_split(&self, len: usize) -> Result<Self::Result, ErrorReason>

Calculates the statistics of the data contained in the vector as if the vector would have been split into len pieces. self.len should be dividable by len without a remainder, but this isn’t enforced by the implementation. For implementation reasons len <= 16 must be true.

§Example
use basic_dsp_vector::*;
let vector = vec!(Complex32::new(1.0, 2.0), Complex32::new(3.0, 4.0), Complex32::new(5.0, 6.0)).to_complex_time_vec();
let result = vector.statistics_split(2).expect("Ignoring error handling in examples");
assert_eq!(result[0].sum, Complex32::new(6.0, 8.0));
assert_eq!(result[1].sum, Complex32::new(3.0, 4.0));
}

Implementors§

source§

impl<S, T, N, D> StatisticsSplitOps<Complex<T>> for DspVec<S, T, N, D>
where S: ToSlice<T>, T: RealNumber, N: ComplexNumberSpace, D: Domain,

§

type Result = ArrayVec<Statistics<Complex<T>>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>

source§

impl<S, T, N, D> StatisticsSplitOps<T> for DspVec<S, T, N, D>
where S: ToSlice<T>, T: RealNumber, N: RealNumberSpace, D: Domain,

§

type Result = ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>

source§

impl<S, V, T> StatisticsSplitOps<T> for Matrix2xN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + StatisticsSplitOps<Statistics<T>, Result = ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>, T: RealNumber,

§

type Result = [ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>; 2]

source§

impl<S, V, T> StatisticsSplitOps<T> for Matrix3xN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + StatisticsSplitOps<Statistics<T>, Result = ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>, T: RealNumber,

§

type Result = [ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>; 3]

source§

impl<S, V, T> StatisticsSplitOps<T> for Matrix4xN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + StatisticsSplitOps<Statistics<T>, Result = ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>, T: RealNumber,

§

type Result = [ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>; 4]

source§

impl<S, V, T> StatisticsSplitOps<T> for MatrixMxN<V, S, T>
where S: ToSlice<T>, V: Vector<T> + StatisticsSplitOps<Statistics<T>, Result = ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>, T: RealNumber,

§

type Result = Vec<ArrayVec<Statistics<T>, basic_dsp_vector::::vector_types::general::statistics::StatsVec::{constant#0}>>