mirror of
https://github.com/boostorg/graph.git
synced 2026-02-26 16:52:12 +00:00
Merged r75066, r75067, r75124, r75140, r75165, r75861, r75862, r75863, r75878, r75906, r75970, r75973, r75974, and r76394 from trunk
[SVN r76536]
This commit is contained in:
@@ -77,23 +77,11 @@ check_articulation_points(const Graph& g, std::vector<Vertex> art_points)
|
||||
} else std::cout << "OK." << std::endl;
|
||||
}
|
||||
|
||||
int test_main(int argc, char* argv[])
|
||||
{
|
||||
std::size_t n = 100;
|
||||
std::size_t m = 500;
|
||||
std::size_t seed = 1;
|
||||
typedef adjacency_list<listS, vecS, undirectedS,
|
||||
no_property, EdgeProperty> Graph;
|
||||
typedef graph_traits<Graph>::vertex_descriptor Vertex;
|
||||
|
||||
if (argc > 1) n = lexical_cast<std::size_t>(argv[1]);
|
||||
if (argc > 2) m = lexical_cast<std::size_t>(argv[2]);
|
||||
if (argc > 3) seed = lexical_cast<std::size_t>(argv[3]);
|
||||
|
||||
typedef adjacency_list<listS, vecS, undirectedS,
|
||||
no_property, EdgeProperty> Graph;
|
||||
typedef graph_traits<Graph>::vertex_descriptor Vertex;
|
||||
|
||||
Graph g(n);
|
||||
minstd_rand gen(seed);
|
||||
generate_random_graph(g, n, m, gen);
|
||||
bool test_graph(Graph& g) { // Returns false on failure
|
||||
std::vector<Vertex> art_points;
|
||||
|
||||
std::cout << "Computing biconnected components & articulation points... ";
|
||||
@@ -127,5 +115,34 @@ int test_main(int argc, char* argv[])
|
||||
out << "}\n";
|
||||
}
|
||||
|
||||
return any_errors;
|
||||
}
|
||||
|
||||
int test_main(int argc, char* argv[])
|
||||
{
|
||||
std::size_t n = 100;
|
||||
std::size_t m = 500;
|
||||
std::size_t seed = 1;
|
||||
|
||||
if (argc > 1) n = lexical_cast<std::size_t>(argv[1]);
|
||||
if (argc > 2) m = lexical_cast<std::size_t>(argv[2]);
|
||||
if (argc > 3) seed = lexical_cast<std::size_t>(argv[3]);
|
||||
|
||||
{
|
||||
Graph g(n);
|
||||
minstd_rand gen(seed);
|
||||
generate_random_graph(g, n, m, gen);
|
||||
if (test_graph(g)) return 1;
|
||||
}
|
||||
|
||||
{
|
||||
Graph g(4);
|
||||
add_edge(2, 3, g);
|
||||
add_edge(0, 3, g);
|
||||
add_edge(0, 2, g);
|
||||
add_edge(1, 0, g);
|
||||
if (test_graph(g)) return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user