[][src]Trait basic_dsp_vector::PreciseSumOps

pub trait PreciseSumOps<T>: Sized where
    T: Sized
{ fn sum_prec(&self) -> T;
fn sum_sq_prec(&self) -> T; }

Offers the same functionality as the SumOps trait but the sums are calculated in a more precise (and slower) way.

Required methods

fn sum_prec(&self) -> T

Calculates the sum of the data contained in the vector using a more precise but slower algorithm.

Example

use basic_dsp_vector::*;
let vector = vec!(1.0, 2.0, 3.0, 4.0, 5.0, 6.0).to_complex_time_vec();
let result = vector.sum_prec();
assert_eq!(result, Complex64::new(9.0, 12.0));
}

fn sum_sq_prec(&self) -> T

Calculates the sum of the squared data contained in the vector using a more precise but slower algorithm.

Example

use basic_dsp_vector::*;
let vector = vec!(1.0, 2.0, 3.0, 4.0, 5.0, 6.0).to_complex_time_vec();
let result = vector.sum_sq_prec();
assert_eq!(result, Complex64::new(-21.0, 88.0));
}
Loading content...

Implementors

impl<S, N, D> PreciseSumOps<f64> for DspVec<S, f32, N, D> where
    S: ToSlice<f32>,
    N: RealNumberSpace,
    D: Domain
[src]

impl<S, N, D> PreciseSumOps<f64> for DspVec<S, f64, N, D> where
    S: ToSlice<f64>,
    N: RealNumberSpace,
    D: Domain
[src]

impl<S, N, D> PreciseSumOps<Complex<f64>> for DspVec<S, f32, N, D> where
    S: ToSlice<f32>,
    N: ComplexNumberSpace,
    D: Domain
[src]

impl<S, N, D> PreciseSumOps<Complex<f64>> for DspVec<S, f64, N, D> where
    S: ToSlice<f64>,
    N: ComplexNumberSpace,
    D: Domain
[src]

Loading content...