MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / rbk_single_data

Function rbk_single_data

test/reduce.cpp:490–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488
489template<typename Tk, typename Tv, typename To>
490reduce_by_key_params *rbk_single_data(const string testname, const int testSz,
491 std::function<Tk()> k_gen,
492 std::function<Tv()> v_gen) {
493 vector<Tk> keys(testSz);
494 vector<Tv> vals(testSz);
495
496 generate(begin(keys), end(keys), k_gen);
497 generate(begin(vals), end(vals), v_gen);
498
499 vector<Tk> okeys(begin(keys), end(keys));
500 auto last = unique(begin(okeys), end(okeys));
501 okeys.resize(distance(begin(okeys), last));
502 vector<To> ovals(okeys.size(), To(keys.size()));
503 return new reduce_by_key_params_t<Tk, Tv, To>(keys, vals, okeys, ovals,
504 testname);
505}
506
507// clang-format off
508template<typename Tk, typename Tv, typename To>

Callers

nothing calls this directly

Calls 3

beginFunction · 0.85
endFunction · 0.85
distanceFunction · 0.50

Tested by

no test coverage detected