mirror of
https://github.com/boostorg/graph.git
synced 2026-02-26 04:42:16 +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:
@@ -8,6 +8,7 @@
|
||||
# LEDA (also top level directory) at the command line of jam using -s
|
||||
|
||||
import modules ;
|
||||
import path ;
|
||||
|
||||
path-constant TEST_DIR : . ;
|
||||
|
||||
@@ -124,23 +125,22 @@ test-suite graph_test :
|
||||
;
|
||||
|
||||
# Run SDB tests only when -sSDB= is set.
|
||||
if [ modules.peek : SDB ] != ""
|
||||
local SDB = [ modules.peek : SDB ] ;
|
||||
if $(SDB)
|
||||
{
|
||||
local SDB_DEPENDENCIES =
|
||||
<include>$(SGB) <library-file>$(SGB)/libgb.a ;
|
||||
local sdb-root = [ path.root [ path.make $(SDB) ] [ path.pwd ] ] ;
|
||||
|
||||
compile stanford_graph_cc.cpp
|
||||
$(SDB_DEPENDENCIES) ;
|
||||
compile stanford_graph_cc.cpp :
|
||||
<include>$(sdb-root) ;
|
||||
}
|
||||
|
||||
# Run LEDA tests only when -sLEDA= is set.
|
||||
if [ modules.peek : LEDA ] != ""
|
||||
local LEDA = [ modules.peek : LEDA ] ;
|
||||
if $(LEDA)
|
||||
{
|
||||
local LEDA_DEPENDENCIES =
|
||||
<include>$(LEDA)/incl
|
||||
<library-file>$(LEDA)/libG.a
|
||||
;
|
||||
local leda-root = [ path.root [ path.make $(LEDA) ] [ path.pwd ] ] ;
|
||||
local leda-include = [ path.join $(leda-root) incl ] ;
|
||||
|
||||
compile leda_graph_cc.cpp
|
||||
$(LEDA_DEPENDENCIES) ;
|
||||
compile leda_graph_cc.cpp :
|
||||
<include>$(leda-include) ;
|
||||
}
|
||||
|
||||
@@ -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