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

Function rand_day_millis

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

Source from the content-addressed store, hash-verified

1455} // namespace random
1456
1457void rand_day_millis(int64_t N, std::vector<DayTimeIntervalType::DayMilliseconds>* out) {
1458 const int random_seed = 0;
1459 arrow::random::pcg32 gen(random_seed);
1460 std::uniform_int_distribution<int32_t> d(std::numeric_limits<int32_t>::min(),
1461 std::numeric_limits<int32_t>::max());
1462 out->resize(N, {});
1463 std::generate(out->begin(), out->end(), [&d, &gen] {
1464 DayTimeIntervalType::DayMilliseconds tmp;
1465 tmp.days = d(gen);
1466 tmp.milliseconds = d(gen);
1467 return tmp;
1468 });
1469}
1470
1471void rand_month_day_nanos(int64_t N,
1472 std::vector<MonthDayNanoIntervalType::MonthDayNanos>* out) {

Callers 1

drawMethod · 0.85

Calls 3

resizeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by 1

drawMethod · 0.68