Daily bit(e) of C++ | std::transform_inclusive_scan, std::transform_exclusive_scan
Daily bit(e) of C++ #239, Algorithms for computing prefix sum from transformed values: std::transform_inclusive_scan, std::transform_exclusive_scan.
The std::transform_inclusive_scan and std::transform_exclusive_scan compute the inclusive/exclusive prefix sum from the results of a transformation applied to each element.
Unlike std::partial_sum, the prefix sum is generalized and not evaluated in strict order, requiring associative reduction operation for deterministic results.