Skip to main content

reduce

Function reduce 

Source
pub fn reduce<const K: usize, F>(count: usize, row: F) -> Tsqr<K>
where F: Fn(usize) -> Option<[f64; K]> + Sync,
Expand description

Assembles R from the rows returned by row.

row(i) returns None for rows to skip — rejected correspondences, for instance.

§Determinism

The reduction tree is fully specified: blocks are cut by a fixed internal constant, rows within a block are folded in increasing index order, and blocks merge through a balanced binary tree in a fixed order. The result is bit-for-bit identical at any thread count.

A balanced tree rather than a sequential fold: error accumulation grows as log P for the former and as P for the latter.