pub trait PreciseStatisticsSplitOps<T> {
type Result;
fn statistics_split_prec(&self, len: usize) -> ScalarResult<Self::Result>;
}
Expand description
Offers the same functionality as the StatisticsOps
trait but
the statistics are calculated in a more precise (and slower) way.
Required Associated Types
Required Methods
sourcefn statistics_split_prec(&self, len: usize) -> ScalarResult<Self::Result>
fn statistics_split_prec(&self, len: usize) -> ScalarResult<Self::Result>
Calculates the statistics of the data contained in the vector as if the vector would
have been split into len
pieces
using a more precise but slower algorithm. 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<Complex<f32>> = vec!(Complex::new(1.0, 2.0), Complex::new(3.0, 4.0), Complex::new(5.0, 6.0));
let vector = vector.to_complex_time_vec();
let result = vector.statistics_split_prec(2).expect("Ignoring error handling in examples");
assert_eq!(result[0].sum, Complex64::new(6.0, 8.0));
assert_eq!(result[1].sum, Complex64::new(3.0, 4.0));
}