Trait basic_dsp::MapAggregateOps
source · [−]pub trait MapAggregateOps<T, R>where
R: Send,{
type Output;
fn map_aggregate<'a, A, FMap, FAggr>(
&self,
argument: A,
map: &FMap,
aggregate: &FAggr
) -> Self::Output
where
A: Sync + Copy + Send,
FMap: 'a + Fn(T, usize, A) -> R + Sync,
FAggr: 'a + Fn(R, R) -> R + Sync + Send;
}
Expand description
Operations which allow to iterate over the vector and to derive results.
Required Associated Types
Required Methods
sourcefn map_aggregate<'a, A, FMap, FAggr>(
&self,
argument: A,
map: &FMap,
aggregate: &FAggr
) -> Self::Outputwhere
A: Sync + Copy + Send,
FMap: 'a + Fn(T, usize, A) -> R + Sync,
FAggr: 'a + Fn(R, R) -> R + Sync + Send,
fn map_aggregate<'a, A, FMap, FAggr>(
&self,
argument: A,
map: &FMap,
aggregate: &FAggr
) -> Self::Outputwhere
A: Sync + Copy + Send,
FMap: 'a + Fn(T, usize, A) -> R + Sync,
FAggr: 'a + Fn(R, R) -> R + Sync + Send,
Transforms all vector elements using the function map
and then aggregates
all the results with aggregate
. aggregate
must be a commutativity and associativity;
that’s because there is no guarantee that the numbers will
be aggregated in any deterministic order.