MCPcopy Create free account
hub / github.com/Dobiasd/FunctionalPlus / sample

Function sample

include/fplus/transform.hpp:201–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199// Example call: sample(std::random_device()(), 3, xs);
200template <typename Container>
201Container sample(std::uint_fast32_t seed, std::size_t n, const Container& xs)
202{
203 assert(n <= size_of_cont(xs));
204 return get_segment(0, n, shuffle(seed, xs));
205}
206
207// API search type: random_element : (Int, [a]) -> a
208// fwd bind count: 1

Callers 3

transform_test.cppFile · 0.50
problem_23Function · 0.50
problem_24Function · 0.50

Calls 3

size_of_contFunction · 0.70
get_segmentFunction · 0.70
shuffleFunction · 0.70

Tested by

no test coverage detected