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

Function rbk_unique_data

test/reduce.cpp:472–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470
471template<typename Tk, typename Tv, typename To>
472reduce_by_key_params *rbk_unique_data(const string testname, const int testSz,
473 std::function<Tk()> k_gen,
474 std::function<Tv()> v_gen) {
475 vector<Tk> keys(testSz);
476 vector<Tv> vals(testSz);
477
478 generate(begin(keys), end(keys), k_gen);
479 generate(begin(vals), end(vals), v_gen);
480
481 vector<Tk> okeys(begin(keys), end(keys));
482 auto last = unique(begin(okeys), end(okeys));
483 okeys.resize(distance(begin(okeys), last));
484 vector<To> ovals(testSz, To(1));
485 return new reduce_by_key_params_t<Tk, Tv, To>(keys, vals, okeys, ovals,
486 testname);
487}
488
489template<typename Tk, typename Tv, typename To>
490reduce_by_key_params *rbk_single_data(const string testname, const int testSz,

Callers

nothing calls this directly

Calls 3

beginFunction · 0.85
endFunction · 0.85
distanceFunction · 0.50

Tested by

no test coverage detected