MCPcopy Create free account
hub / github.com/apache/arrow / GenerateBitmap

Method GenerateBitmap

cpp/src/arrow/testing/random.cc:139–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers 5

GenerateNumericArrayFunction · 0.80
NullBitmapMethod · 0.80
BooleanMethod · 0.80
FixedSizeBinaryMethod · 0.80
GenerateOffsetsFunction · 0.80

Calls 1

SetBitFunction · 0.85

Tested by

no test coverage detected