|
Template Numerical Library version\ main:4e6e2c1
|
This page provides an overview of all scan (prefix-sum) functions available for segment operations, helping to understand the differences between variants and choose the right function for your needs.
These functions compute scan within specified segments:
| Function | Segments Scanned | Scan Type |
|---|---|---|
| Segments_inclusiveScanAllSegments | All segments | Inclusive |
| Segments_exclusiveScanAllSegments | All segments | Exclusive |
| Segments_inclusiveScanSegments_range (range) | Segments [begin, end) | Inclusive |
| Segments_exclusiveScanSegments_range (range) | Segments [begin, end) | Exclusive |
| Segments_inclusiveScanSegments_with_segment_indices (array) | Segments in array | Inclusive |
| Segments_exclusiveScanSegments_with_segment_indices (array) | Segments in array | Exclusive |
When to use:
These functions add segment-level conditions, including only segments that satisfy the condition in the scan:
| Function | Segments Scanned | Scan Type |
|---|---|---|
| Segments_inclusiveScanAllSegmentsIf | All segments | Inclusive with segment filter |
| Segments_exclusiveScanAllSegmentsIf | All segments | Exclusive with segment filter |
| Segments_inclusiveScanSegmentsIf_range | Segments [begin, end) | Inclusive with segment filter |
| Segments_exclusiveScanSegmentsIf_range | Segments [begin, end) | Exclusive with segment filter |
When to use:
| Function | Purpose |
|---|---|
| Segments_inclusiveScanSegment | Computes inclusive scan for a single segment view |
| Segments_exclusiveScanSegment | Computes exclusive scan for a single segment view |
When to use:
All scan functions share these common parameters:
Conditional variants additionally require:
In-place vs. out-of-place:
Performance considerations: