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

Function random_is_valid

cpp/src/arrow/testing/util.cc:67–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void random_is_valid(int64_t n, double pct_null, std::vector<bool>* is_valid,
68 int random_seed) {
69 pcg32_fast gen(random_seed);
70 ::arrow::random::uniform_real_distribution<double> d(0.0, 1.0);
71 is_valid->resize(n, false);
72 std::generate(is_valid->begin(), is_valid->end(),
73 [&d, &gen, &pct_null] { return d(gen) > pct_null; });
74}
75
76void random_bytes(int64_t n, uint32_t seed, uint8_t* out) {
77 pcg32_fast gen(seed);

Callers 7

TESTFunction · 0.85
CheckSliceApproxEqualsFunction · 0.85
InitValues<bool>Function · 0.85
TESTFunction · 0.85
MakeSimpleListArrayFunction · 0.85
operator()Method · 0.85

Calls 3

resizeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by 7

TESTFunction · 0.68
CheckSliceApproxEqualsFunction · 0.68
InitValues<bool>Function · 0.68
TESTFunction · 0.68
MakeSimpleListArrayFunction · 0.68
operator()Method · 0.68