| 137 | } |
| 138 | |
| 139 | void GenerateBitmap(uint8_t* buffer, size_t n, int64_t* null_count) { |
| 140 | int64_t count = 0; |
| 141 | pcg32 rng(seed_++); |
| 142 | ::arrow::random::bernoulli_distribution dist(1.0 - probability_); |
| 143 | |
| 144 | for (size_t i = 0; i < n; i++) { |
| 145 | if (dist(rng)) { |
| 146 | bit_util::SetBit(buffer, i); |
| 147 | } else { |
| 148 | count++; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | if (null_count != nullptr) *null_count = count; |
| 153 | } |
| 154 | |
| 155 | static constexpr PhysicalType get_nan() { |
| 156 | if constexpr (kIsHalfFloat) { |
no test coverage detected