MCPcopy Create free account
hub / github.com/ConorWilliams/libfork / random_vec

Function random_vec

test/source/algorithm/scan.cpp:35–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35auto random_vec(std::type_identity<int>, std::size_t n) -> std::vector<int> {
36
37 std::vector<int> out(n);
38
39 lf::xoshiro rng{lf::seed, std::random_device{}};
40 std::uniform_int_distribution<int> dist{0, std::numeric_limits<int>::max() / (static_cast<int>(n) + 1) / 2};
41
42 for (auto &&elem : out) {
43 elem = dist(rng);
44 }
45
46 return out;
47}
48
49auto random_vec(std::type_identity<std::string>, std::size_t n) -> std::vector<std::string> {
50

Callers 2

testFunction · 0.70
fold.cppFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected