| 66 | /// found in run_ends |
| 67 | template <typename RunEndCType> |
| 68 | int64_t FindPhysicalIndex(const RunEndCType* run_ends, int64_t run_ends_size, int64_t i, |
| 69 | int64_t absolute_offset) { |
| 70 | assert(absolute_offset + i >= 0); |
| 71 | auto it = std::upper_bound(run_ends, run_ends + run_ends_size, absolute_offset + i); |
| 72 | int64_t result = std::distance(run_ends, it); |
| 73 | assert(result <= run_ends_size); |
| 74 | return result; |
| 75 | } |
| 76 | |
| 77 | /// \brief Uses binary-search to calculate the range of physical values (and |
| 78 | /// run-ends) necessary to represent the logical range of values from |
no outgoing calls