| 76 | /// found in run_ends |
| 77 | template <typename RunEndCType> |
| 78 | int64_t FindPhysicalIndex(const RunEndCType* run_ends, int64_t run_ends_size, int64_t i, |
| 79 | int64_t absolute_offset) { |
| 80 | assert(absolute_offset + i >= 0); |
| 81 | auto it = std::upper_bound(run_ends, run_ends + run_ends_size, absolute_offset + i); |
| 82 | int64_t result = std::distance(run_ends, it); |
| 83 | assert(result <= run_ends_size); |
| 84 | return result; |
| 85 | } |
| 86 | |
| 87 | /// \brief Uses binary-search to calculate the range of physical values (and |
| 88 | /// run-ends) necessary to represent the logical range of values from |
no outgoing calls