Function plane_exclusive_sum

Source
pub fn plane_exclusive_sum<E: CubePrimitive>(value: E) -> E
Expand description

Perform an exclusive sum operation across all units in a plane. This sums all values to the “left” of the unit, excluding this unit’s value. The 0th unit will be set to E::zero(). Also known as “exclusive prefix sum” or “exclusive scan”.

§Example

exclusive_sum([1, 2, 3, 4, 5]) == [0, 1, 3, 6, 10]