16 #include "cmdline.hpp"
19 int main(
int argc,
char** argv) {
20 pasl::util::cmdline::set(argc, argv);
23 using vertex_set_type = std::set<const void*>;
27 std::string str =
"Functions delay binding; data structures induce binding. Moral: Structure data late in the programming process.";
29 for (
int i = 0; i < str.size(); i++)
32 for (
int i = 0; i < 500; i++) {
34 size_t k = rand() % c.size();
45 vertex_set_type vtxset;
47 auto add_edge = [&] (
const void* src,
const void* dst) {
50 std::cout << (long)dst <<
" -- " << (
long)src << std::endl;
53 auto process_chunk = [&] <
typename Chunk> (Chunk* c) {
55 c->for_each([&] (
char c) {
58 auto it = vtxset.find(c);
60 std::cout << (long)c <<
"[shape=record,label=\"" << str <<
"\"]" << std::endl;
63 std::cout <<
"graph g{" << std::endl;
64 std::cout <<
"rankdir=LR" << std::endl;
65 std::cout <<
"ratio=auto" << std::endl;
66 c.reveal_internal_structure(add_edge, process_chunk);
67 for (
auto it = vtxset.begin(); it != vtxset.end(); it++)
68 std::cout << (
long)*it <<
"[shape=record,label=\"\"]" << std::endl;
69 std::cout <<
"}" << std::endl;
void push_back(const value_type &x)
Adds item at the end.
int main(int argc, char **argv)
Chunked-sequence functor.