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

Function FillRandomData

cpp/src/arrow/ipc/test_common.cc:1168–1174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1166
1167template <typename CValueType, typename SeedType, typename DistributionType>
1168void FillRandomData(CValueType* data, size_t n, CValueType min, CValueType max,
1169 SeedType seed) {
1170 std::default_random_engine rng(seed);
1171 DistributionType dist(min, max);
1172 std::generate(data, data + n,
1173 [&dist, &rng] { return static_cast<CValueType>(dist(rng)); });
1174}
1175
1176template <typename CValueType, typename SeedType>
1177enable_if_t<std::is_integral<CValueType>::value && std::is_signed<CValueType>::value,

Callers 1

MakeRandomTensorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected