30# include <gsl/gsl_rng.h>
32# include <tclap/CmdLine.h>
46 {
"n",
"num",
"num of keys",
false, 10,
"num of keys",
cmd };
49 "seed for random",
cmd };
59 for (
size_t i = 0; i < n; ++i)
67 tbl.for_each([] (
auto p) { cout << p.first <<
", " << p.second <<
endl; });
69 for (
auto it =
tbl.get_it(); it.has_curr(); it.next())
71 auto p = it.get_curr();
73 auto ptr =
tbl.search(key);
74 cout << key <<
" == " << ptr->first <<
" " << p.second <<
" == "
75 << ptr->second <<
endl;
77 assert(p.second == ptr->second);
80 for (
size_t i = 0; i < n; ++i)
83 auto ptr =
tbl.search(p1.first);
84 assert(p1.first == ptr->first);
85 assert(p1.second == ptr->second);
Core header for the Aleph-w library.
T & append()
Allocate a new entry to the end of array.
MapOLhash< int, Foo > tbl
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
std::string to_string(const time_t t, const std::string &format)
Format a time_t value into a string using format.
ValueArg< size_t > num_keys
Dynamic set implementations based on hash tables.