fpmas 1.6
random_graph_builder.h
Go to the documentation of this file.
1#ifndef FPMAS_RANDOM_GRAPH_BUILDER_H
2#define FPMAS_RANDOM_GRAPH_BUILDER_H
3
5
10namespace fpmas { namespace graph {
20 protected:
24 std::function<std::size_t()> num_edge;
36 template<typename Generator_t, typename EdgeDist>
38 Generator_t& generator,
39 EdgeDist& edge_distribution) :
40 // A lambda function is used to "catch" generator end
41 // edge_distribution, without requiring class level
42 // template parameters. Moreover, template arguments can be
43 // automatically deduced in the context of a constructor,
44 // but not at the class level.
45 num_edge([&generator, &edge_distribution] () {
46 return edge_distribution(generator);
47 }) {}
48 public:
60
67 };
68}}
69#endif
Definition: random_graph_builder.h:19
std::function< std::size_t()> num_edge
Definition: random_graph_builder.h:24
static void seed(random::mt19937_64::result_type seed)
Definition: random_graph_builder.cpp:7
static random::mt19937_64 rd
Definition: random_graph_builder.h:59
RandomGraphBuilder(Generator_t &generator, EdgeDist &edge_distribution)
Definition: random_graph_builder.h:37
static random::DistributedGenerator distributed_rd
Definition: random_graph_builder.h:52
Definition: generator.h:322
Definition: generator.h:113
UniformRandomBitGenerator< Generator_t >::result_type result_type
Definition: generator.h:120
Definition: fpmas.cpp:3