summaryrefslogtreecommitdiff
path: root/src/Skeleton_blocker
diff options
context:
space:
mode:
Diffstat (limited to 'src/Skeleton_blocker')
-rw-r--r--src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp16
-rw-r--r--src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp8
-rw-r--r--src/Skeleton_blocker/example/Skeleton_blocker_link.cpp10
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h20
-rw-r--r--src/Skeleton_blocker/test/test_skeleton_blocker_complex.cpp88
-rw-r--r--src/Skeleton_blocker/test/test_skeleton_blocker_geometric_complex.cpp16
-rw-r--r--src/Skeleton_blocker/test/test_skeleton_blocker_simplifiable.cpp92
7 files changed, 125 insertions, 125 deletions
diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp
index 486827eb..d04ca289 100644
--- a/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp
+++ b/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp
@@ -35,13 +35,13 @@ int main(int argc, char *argv[]) {
Complex complex(Gudhi::skeleton_blocker::make_complex_from_top_faces<Complex>(simplices.begin(), simplices.end()));
- std::cout << "Simplices:" << std::endl;
+ std::clog << "Simplices:" << std::endl;
for (const Simplex & s : complex.complex_simplex_range())
- std::cout << s << " ";
- std::cout << std::endl;
+ std::clog << s << " ";
+ std::clog << std::endl;
// One blocker as simplex 0123 is not in the complex but all its proper faces are.
- std::cout << "Blockers: " << complex.blockers_to_string() << std::endl;
+ std::clog << "Blockers: " << complex.blockers_to_string() << std::endl;
// now build a complex from its full list of simplices
simplices.clear();
@@ -53,13 +53,13 @@ int main(int argc, char *argv[]) {
simplices.push_back(Simplex(Vertex_handle(2), Vertex_handle(0)));
complex = Complex(simplices.begin(), simplices.end());
- std::cout << "Simplices:" << std::endl;
+ std::clog << "Simplices:" << std::endl;
for (const Simplex & s : complex.complex_simplex_range())
- std::cout << s << " ";
- std::cout << std::endl;
+ std::clog << s << " ";
+ std::clog << std::endl;
// One blocker as simplex 012 is not in the complex but all its proper faces are.
- std::cout << "Blockers: " << complex.blockers_to_string() << std::endl;
+ std::clog << "Blockers: " << complex.blockers_to_string() << std::endl;
return EXIT_SUCCESS;
}
diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp
index 7f301047..62084692 100644
--- a/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp
+++ b/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp
@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {
// more appropriated!
unsigned num_vertices = 0;
for (auto v : complex.vertex_range()) {
- std::cout << "Vertex " << v << std::endl;
+ std::clog << "Vertex " << v << std::endl;
++num_vertices;
}
@@ -65,9 +65,9 @@ int main(int argc, char *argv[]) {
else
euler -= 1;
}
- std::cout << "Saw " << num_vertices << " vertices, " << num_edges << " edges and " << num_simplices << " simplices"
+ std::clog << "Saw " << num_vertices << " vertices, " << num_edges << " edges and " << num_simplices << " simplices"
<< std::endl;
- std::cout << "The Euler Characteristic is " << euler << std::endl;
- std::cout << skbl_chrono;
+ std::clog << "The Euler Characteristic is " << euler << std::endl;
+ std::clog << skbl_chrono;
return EXIT_SUCCESS;
}
diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp
index e634b656..ba7ce43c 100644
--- a/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp
+++ b/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp
@@ -32,25 +32,25 @@ int main(int argc, char *argv[]) {
Simplex tetrahedron(Vertex_handle(0), Vertex_handle(1), Vertex_handle(2), Vertex_handle(3));
complex.add_simplex(tetrahedron);
- std::cout << "complex:" << complex.to_string() << std::endl;
+ std::clog << "complex:" << complex.to_string() << std::endl;
// build the link of vertex 1, eg a triangle {0,2,3}
auto link = complex.link(Vertex_handle(1));
- std::cout << "link:" << link.to_string() << std::endl;
+ std::clog << "link:" << link.to_string() << std::endl;
// Internally link is a subcomplex of 'complex' and its vertices are stored in a vector.
// They can be accessed via Vertex_handle(x) where x is an index of the vector.
// In that example, link has three vertices and thus it contains only
// Vertex_handle(0),Vertex_handle(1) and Vertex_handle(2) are).
for (int i = 0; i < 5; ++i)
- std::cout << "link.contains_vertex(Vertex_handle(" << i << ")):" << link.contains_vertex(Vertex_handle(i)) <<
+ std::clog << "link.contains_vertex(Vertex_handle(" << i << ")):" << link.contains_vertex(Vertex_handle(i)) <<
std::endl;
- std::cout << std::endl;
+ std::clog << std::endl;
// To access to the initial vertices eg (0,1,2,3,4), Root_vertex_handle must be used.
// For instance, to test if the link contains the vertex that was labeled i:
for (int i = 0; i < 5; ++i)
- std::cout << "link.contains_vertex(Root_vertex_handle(" << i << ")):" <<
+ std::clog << "link.contains_vertex(Root_vertex_handle(" << i << ")):" <<
link.contains_vertex(Root_vertex_handle(i)) << std::endl;
return EXIT_SUCCESS;
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h
index bcca851f..653a63fd 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h
@@ -154,8 +154,8 @@ of a simplicial complex.
else
euler -= 1;
}
- std::cout << "Saw "<<num_vertices<<" vertices, "<<num_edges<<" edges and "<<num_simplices<<" simplices"<<std::endl;
- std::cout << "The Euler Characteristic is "<<euler<<std::endl;
+ std::clog << "Saw "<<num_vertices<<" vertices, "<<num_edges<<" edges and "<<num_simplices<<" simplices"<<std::endl;
+ std::clog << "The Euler Characteristic is "<<euler<<std::endl;
\endcode
@@ -182,13 +182,13 @@ The Euler Characteristic is 1
//get complex from top faces
make_complex_from_top_faces(complex,simplices.begin(),simplices.end());
- std::cout << "Simplices:"<<std::endl;
+ std::clog << "Simplices:"<<std::endl;
for(const Simplex & s : complex.star_simplex_range())
- std::cout << s << " ";
- std::cout << std::endl;
+ std::clog << s << " ";
+ std::clog << std::endl;
//One blocker as simplex 0123 is not in the complex but all its proper faces are.
- std::cout << "Blockers: "<<complex.blockers_to_string()<<std::endl;
+ std::clog << "Blockers: "<<complex.blockers_to_string()<<std::endl;
//now build a complex from its full list of simplices
simplices.clear();
@@ -200,13 +200,13 @@ The Euler Characteristic is 1
simplices.push_back(Simplex(Vertex_handle(2),Vertex_handle(0)));
complex = Complex(simplices.begin(),simplices.end());
- std::cout << "Simplices:"<<std::endl;
+ std::clog << "Simplices:"<<std::endl;
for(const Simplex & s : complex.star_simplex_range())
- std::cout << s << " ";
- std::cout << std::endl;
+ std::clog << s << " ";
+ std::clog << std::endl;
//One blocker as simplex 012 is not in the complex but all its proper faces are.
- std::cout << "Blockers: "<<complex.blockers_to_string()<<std::endl;
+ std::clog << "Blockers: "<<complex.blockers_to_string()<<std::endl;
\endcode
\verbatim
./SkeletonBlockerFromSimplices
diff --git a/src/Skeleton_blocker/test/test_skeleton_blocker_complex.cpp b/src/Skeleton_blocker/test/test_skeleton_blocker_complex.cpp
index 4336e33b..96438acf 100644
--- a/src/Skeleton_blocker/test/test_skeleton_blocker_complex.cpp
+++ b/src/Skeleton_blocker/test/test_skeleton_blocker_complex.cpp
@@ -91,10 +91,10 @@ BOOST_AUTO_TEST_CASE(test_skeleton_num_simplices) {
BOOST_AUTO_TEST_CASE(test_skeleton_iterator_vertices1) {
int n = 10;
Complex complex(10);
- std::cout << "complex.num_vertices():" << complex.num_vertices() << std::endl;
+ std::clog << "complex.num_vertices():" << complex.num_vertices() << std::endl;
int num_vertex_seen = 0;
for (auto vi : complex.vertex_range()) {
- std::cout << "vertex:" << vi << std::endl;
+ std::clog << "vertex:" << vi << std::endl;
++num_vertex_seen;
}
BOOST_CHECK(num_vertex_seen == n);
@@ -104,14 +104,14 @@ BOOST_AUTO_TEST_CASE(test_skeleton_iterator_vertices2) {
int n = 10;
Complex complex;
build_complete(10, complex);
- std::cout << "complex.num_vertices():" << complex.num_vertices() << std::endl;
- std::cout << "complex.num_edges():" << complex.num_edges() << std::endl;
+ std::clog << "complex.num_vertices():" << complex.num_vertices() << std::endl;
+ std::clog << "complex.num_edges():" << complex.num_edges() << std::endl;
int num_vertex_seen = 0;
for (auto vi : complex.vertex_range(Vertex_handle(2))) {
- std::cout << "vertex:" << vi << std::endl;
+ std::clog << "vertex:" << vi << std::endl;
++num_vertex_seen;
}
- std::cout << "num_vertex_seen:" << num_vertex_seen << std::endl;
+ std::clog << "num_vertex_seen:" << num_vertex_seen << std::endl;
BOOST_CHECK(num_vertex_seen == (n -1));
}
@@ -123,10 +123,10 @@ BOOST_AUTO_TEST_CASE(test_skeleton_iterator_edge) {
complex.add_edge_without_blockers(Vertex_handle(i), Vertex_handle(j));
complex.remove_edge(Vertex_handle(2), Vertex_handle(3));
complex.remove_edge(Vertex_handle(3), Vertex_handle(5));
- std::cout << "complex.num_edges():" << complex.num_edges() << std::endl;
+ std::clog << "complex.num_edges():" << complex.num_edges() << std::endl;
int num_edges_seen = 0;
for (auto edge : complex.edge_range()) {
- std::cout << "edge :" << complex[edge] << std::endl;
+ std::clog << "edge :" << complex[edge] << std::endl;
++num_edges_seen;
}
@@ -141,10 +141,10 @@ BOOST_AUTO_TEST_CASE(test_skeleton_iterator_edge2) {
complex.add_edge_without_blockers(Vertex_handle(i), Vertex_handle(j));
complex.remove_edge(Vertex_handle(2), Vertex_handle(3));
complex.remove_edge(Vertex_handle(3), Vertex_handle(5));
- std::cout << "complex.num_edges():" << complex.num_edges() << std::endl;
+ std::clog << "complex.num_edges():" << complex.num_edges() << std::endl;
int num_neigbors_seen = 0;
for (auto neighbor : complex.vertex_range(Vertex_handle(2))) {
- std::cout << "neighbor" << neighbor << std::endl;
+ std::clog << "neighbor" << neighbor << std::endl;
++num_neigbors_seen;
}
BOOST_CHECK(num_neigbors_seen == 8);
@@ -160,7 +160,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_iterator_triangles) {
complex.add_edge_without_blockers(Vertex_handle(i), Vertex_handle(i + 1));
complex.add_edge_without_blockers(Vertex_handle(1), Vertex_handle(6));
- std::cout << complex.to_string() << std::endl;
+ std::clog << complex.to_string() << std::endl;
int num_triangles_seen = 0;
//for (auto t : complex.triangle_range(5)){
@@ -214,19 +214,19 @@ BOOST_AUTO_TEST_CASE(test_skeleton_iterator_simplices) {
expected_num_simplices[Vertex_handle(5)] = 7;
for (auto pair : expected_num_simplices) {
- std::cout << "found list: ";
+ std::clog << "found list: ";
unsigned num_simplices_around = 0;
for (const auto& simplex : complex.star_simplex_range(pair.first)) {
simplex.dimension();
- std::cout << simplex << " - ";
+ std::clog << simplex << " - ";
++num_simplices_around;
}
BOOST_CHECK(num_simplices_around == pair.second);
- std::cout << std::endl << "current vertex:" << pair.first << " - ";
- std::cout << "expected_num_simplices:" << pair.second << " - ";
- std::cout << "found:" << num_simplices_around << std::endl;
+ std::clog << std::endl << "current vertex:" << pair.first << " - ";
+ std::clog << "expected_num_simplices:" << pair.second << " - ";
+ std::clog << "found:" << num_simplices_around << std::endl;
}
}
@@ -276,19 +276,19 @@ BOOST_AUTO_TEST_CASE(test_skeleton_iterator_simplices3) {
BOOST_AUTO_TEST_CASE(test_skeleton_iterator_simplices4) {
Complex empty_complex;
for (auto v : empty_complex.vertex_range()) {
- std::cout << v;
+ std::clog << v;
BOOST_CHECK(false);
}
for (auto e : empty_complex.edge_range()) {
- std::cout << e;
+ std::clog << e;
BOOST_CHECK(false);
}
for (auto t : empty_complex.triangle_range()) {
- std::cout << t;
+ std::clog << t;
BOOST_CHECK(false);
}
for (auto s : empty_complex.complex_simplex_range()) {
- std::cout << s;
+ std::clog << s;
BOOST_CHECK(false);
}
}
@@ -297,7 +297,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_iterator_coboundary) {
Complex c;
build_complete(4, c);
c.remove_edge(Vertex_handle(1), Vertex_handle(3));
- std::cout << c.to_string();
+ std::clog << c.to_string();
Simplex s02(Vertex_handle(0), Vertex_handle(2));
int n = 0;
std::set<Simplex> expected;
@@ -373,7 +373,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_link0) {
auto L2 = complex.link(alpha);
BOOST_CHECK(L == L2);
- std::cout << L.to_string();
+ std::clog << L.to_string();
BOOST_CHECK(L.contains_vertex(*L.get_address(Root_vertex_handle(b))));
BOOST_CHECK(L.contains_vertex(*L.get_address(Root_vertex_handle(d))));
@@ -432,9 +432,9 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_link2) {
// Complexes built
// Print result
- std::cout << "complex complex" << complex.to_string();
- std::cout << std::endl << std::endl;
- std::cout << "L= Link_complex(" << alpha << ") : \n" << L.to_string();
+ std::clog << "complex complex" << complex.to_string();
+ std::clog << std::endl << std::endl;
+ std::clog << "L= Link_complex(" << alpha << ") : \n" << L.to_string();
auto L2 = complex.link(alpha);
BOOST_CHECK(L == L2);
@@ -472,9 +472,9 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_link3) {
// Complexes built
// Print result
- std::cout << "complex complex" << complex.to_string();
- std::cout << std::endl << std::endl;
- std::cout << "L= Link_complex(" << alpha << ") : \n" << L.to_string();
+ std::clog << "complex complex" << complex.to_string();
+ std::clog << std::endl << std::endl;
+ std::clog << "L= Link_complex(" << alpha << ") : \n" << L.to_string();
auto L2 = complex.link(alpha);
BOOST_CHECK(L == L2);
@@ -529,8 +529,8 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_link5) {
// Complexes built
// Print result
- std::cout << "Complex: " << complex.to_string()<< std::endl << std::endl;
- std::cout << "Link: " << L.to_string() << std::endl;
+ std::clog << "Complex: " << complex.to_string()<< std::endl << std::endl;
+ std::clog << "Link: " << L.to_string() << std::endl;
// verification
BOOST_CHECK(L.num_vertices() == 0);
@@ -549,8 +549,8 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_link6) {
build_link_of_blocker(complex, alpha, link_blocker_alpha);
// Print result
- std::cout << "Complex: " << complex.to_string()<< std::endl << std::endl;
- std::cout << "Link: " << link_blocker_alpha.to_string() << std::endl;
+ std::clog << "Complex: " << complex.to_string()<< std::endl << std::endl;
+ std::clog << "Link: " << link_blocker_alpha.to_string() << std::endl;
// verification
BOOST_CHECK(link_blocker_alpha.num_vertices() == 1);
@@ -579,12 +579,12 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_link7) {
//the result should be the edge {6,7} plus the blocker {0,1,2}
// Print result
- std::cout << "Complex: " << complex.to_string()<< std::endl << std::endl;
- std::cout << "Link: " << link_blocker_alpha.to_string() << std::endl;
+ std::clog << "Complex: " << complex.to_string()<< std::endl << std::endl;
+ std::clog << "Link: " << link_blocker_alpha.to_string() << std::endl;
Skeleton_blocker_link_complex link_blocker_alpha_cpy = link_blocker_alpha;
- std::cout << "Link copy: " << link_blocker_alpha_cpy.to_string() << std::endl;
+ std::clog << "Link copy: " << link_blocker_alpha_cpy.to_string() << std::endl;
BOOST_CHECK(link_blocker_alpha.num_vertices() == link_blocker_alpha_cpy.num_vertices());
BOOST_CHECK(link_blocker_alpha.num_blockers() == link_blocker_alpha_cpy.num_blockers());
@@ -640,7 +640,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_constructor) {
Complex complex(simplices.begin(), simplices.end());
- std::cout << "Constructor 1:\n" << complex.to_string();
+ std::clog << "Constructor 1:\n" << complex.to_string();
BOOST_CHECK(complex.num_vertices() == 6);
BOOST_CHECK(complex.num_edges() == 10);
@@ -677,10 +677,10 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_constructor2) {
Complex complex(simplices.begin(), simplices.end());
- std::cout << "Constructor 2:\n" << complex.to_string();
+ std::clog << "Constructor 2:\n" << complex.to_string();
for (auto b : complex.const_blocker_range()) {
- std::cout << "b:" << b << std::endl;
+ std::clog << "b:" << b << std::endl;
}
BOOST_CHECK(complex.num_vertices() == 5);
@@ -698,7 +698,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_constructor3) {
Complex complex(simplices.begin(), simplices.end());
- std::cout << "Constructor 3:\n" << complex.to_string();
+ std::clog << "Constructor 3:\n" << complex.to_string();
BOOST_CHECK(complex.num_blockers() == 1);
Sh expected_blocker(Vh(0), Vh(1), Vh(2));
@@ -723,7 +723,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_constructor4) {
Complex complex(simplices.begin(), simplices.end());
- std::cout << "Constructor 4:\n" << complex.to_string();
+ std::clog << "Constructor 4:\n" << complex.to_string();
BOOST_CHECK(complex.num_blockers() == 1);
Sh expected_blocker(Vh(0), Vh(1), Vh(4));
for (auto b : complex.const_blocker_range())
@@ -753,7 +753,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_constructor5) {
Complex complex(simplices.begin(), simplices.end());
- std::cout << "Constructor 5:\n" << complex.to_string();
+ std::clog << "Constructor 5:\n" << complex.to_string();
BOOST_CHECK(complex.num_vertices() == 6);
BOOST_CHECK(complex.num_blockers() == 3);
@@ -773,7 +773,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_constructor6) {
Complex complex(simplices.begin(), simplices.end());
- std::cout << "Constructor 6:\n" << complex.to_string();
+ std::clog << "Constructor 6:\n" << complex.to_string();
BOOST_CHECK(complex.num_vertices() == 4);
BOOST_CHECK(complex.num_blockers() == 1);
@@ -795,7 +795,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_constructor7) {
//get complex from top faces
Complex complex(Gudhi::skeleton_blocker::make_complex_from_top_faces<Complex>(simplices.begin(), simplices.end()));
- std::cout << "Constructor 7:\n" << complex.to_string();
+ std::clog << "Constructor 7:\n" << complex.to_string();
BOOST_CHECK(complex.num_vertices() == 4);
BOOST_CHECK(complex.num_blockers() == 1);
@@ -818,7 +818,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_complex_constructor8) {
//get complex from top faces
Complex complex(Gudhi::skeleton_blocker::make_complex_from_top_faces<Complex>(simplices.begin(), simplices.end()));
- std::cout << "Constructor 8:\n" << complex.to_string();
+ std::clog << "Constructor 8:\n" << complex.to_string();
BOOST_CHECK(complex.num_vertices() == 4);
BOOST_CHECK(complex.num_blockers() == 2);
diff --git a/src/Skeleton_blocker/test/test_skeleton_blocker_geometric_complex.cpp b/src/Skeleton_blocker/test/test_skeleton_blocker_geometric_complex.cpp
index 8cad97a1..9042ddcf 100644
--- a/src/Skeleton_blocker/test/test_skeleton_blocker_geometric_complex.cpp
+++ b/src/Skeleton_blocker/test/test_skeleton_blocker_geometric_complex.cpp
@@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_off_reader_writer) {
Gudhi::skeleton_blocker::Skeleton_blocker_off_reader<Complex> off_reader("test2.off", complex);
BOOST_CHECK(off_reader.is_valid());
- std::cout << "complex has " <<
+ std::clog << "complex has " <<
complex.num_vertices() << " vertices, " <<
complex.num_blockers() << " blockers, " <<
complex.num_edges() << " edges and " <<
@@ -50,8 +50,8 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_off_reader_writer) {
Complex same;
Gudhi::skeleton_blocker::Skeleton_blocker_off_reader<Complex> off_reader2("tmp.off", same);
- std::cout << "\ncomplex:" << complex.to_string() << std::endl;
- std::cout << "\nsame:" << same.to_string() << std::endl;
+ std::clog << "\ncomplex:" << complex.to_string() << std::endl;
+ std::clog << "\nsame:" << same.to_string() << std::endl;
BOOST_CHECK(complex == same);
}
@@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_abstract_link) {
Gudhi::skeleton_blocker::Skeleton_blocker_off_reader<Complex> off_reader("test2.off", complex);
BOOST_CHECK(off_reader.is_valid());
- std::cout << "complex has " <<
+ std::clog << "complex has " <<
complex.num_vertices() << " vertices, " <<
complex.num_blockers() << " blockers, " <<
complex.num_edges() << " edges and " <<
@@ -73,7 +73,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_abstract_link) {
auto link_0 = complex.abstract_link(Vertex_handle(0));
- std::cout << "\n link(0):" << link_0.to_string() << std::endl;
+ std::clog << "\n link(0):" << link_0.to_string() << std::endl;
BOOST_CHECK(link_0.num_vertices() == 2);
BOOST_CHECK(link_0.num_edges() == 1);
@@ -91,13 +91,13 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_abstract_link) {
BOOST_CHECK(link_0[*(edge_handle)].second() == Root_vertex_handle(4));
auto link_geometric_0 = complex.link(Vertex_handle(0));
- std::cout << "\n link_geometric(0):" << link_geometric_0.to_string() << std::endl;
+ std::clog << "\n link_geometric(0):" << link_geometric_0.to_string() << std::endl;
BOOST_CHECK(link_0 == link_geometric_0);
auto print_point = [&](Vertex_handle v) {
- for (auto x : link_geometric_0.point(v)) std::cout << x << " ";
- std::cout << std::endl;
+ for (auto x : link_geometric_0.point(v)) std::clog << x << " ";
+ std::clog << std::endl;
};
std::for_each(link_geometric_0.vertex_range().begin(), link_geometric_0.vertex_range().end(), print_point);
diff --git a/src/Skeleton_blocker/test/test_skeleton_blocker_simplifiable.cpp b/src/Skeleton_blocker/test/test_skeleton_blocker_simplifiable.cpp
index b714753d..a85d4ff0 100644
--- a/src/Skeleton_blocker/test/test_skeleton_blocker_simplifiable.cpp
+++ b/src/Skeleton_blocker/test/test_skeleton_blocker_simplifiable.cpp
@@ -49,12 +49,12 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_contraction1) {
static_cast<Vertex_handle> (y)));
// Print result
- std::cout << "complex before complex" << complex.to_string() << std::endl;
+ std::clog << "complex before complex" << complex.to_string() << std::endl;
- std::cout << std::endl << std::endl;
+ std::clog << std::endl << std::endl;
complex.contract_edge(static_cast<Vertex_handle> (a), static_cast<Vertex_handle> (b));
// Print result
- std::cout << "ContractEdge(0,1)\n";
+ std::clog << "ContractEdge(0,1)\n";
PRINT(complex.to_string());
// verification
@@ -89,13 +89,13 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_contraction2) {
complex.add_blocker(blocker);
// Print result
- std::cout << "complex complex" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "complex complex" << complex.to_string();
+ std::clog << std::endl << std::endl;
complex.contract_edge(static_cast<Vertex_handle> (a), static_cast<Vertex_handle> (b));
- std::cout << "complex.ContractEdge(a,b)" << complex.to_string();
+ std::clog << "complex.ContractEdge(a,b)" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << std::endl << std::endl;
// there should be one blocker (a,c,d,e) in the complex
BOOST_CHECK(complex.contains_blocker(Simplex(static_cast<Vertex_handle> (a), static_cast<Vertex_handle> (x),
@@ -110,8 +110,8 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_link_condition1) {
complex.add_blocker(Simplex(static_cast<Vertex_handle> (0), static_cast<Vertex_handle> (1), static_cast<Vertex_handle> (2)));
// Print result
- std::cout << "complex complex" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "complex complex" << complex.to_string();
+ std::clog << std::endl << std::endl;
BOOST_CHECK(complex.link_condition(Vertex_handle(1), Vertex_handle(2), true));
@@ -125,13 +125,13 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_collapse0) {
complex.add_edge_without_blockers(static_cast<Vertex_handle> (2), static_cast<Vertex_handle> (4));
complex.add_edge_without_blockers(static_cast<Vertex_handle> (3), static_cast<Vertex_handle> (4));
// Print result
- std::cout << "initial complex :\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "initial complex :\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
Simplex simplex_123(static_cast<Vertex_handle> (1), static_cast<Vertex_handle> (2), static_cast<Vertex_handle> (3));
complex.remove_star(simplex_123);
- std::cout << "complex.remove_star(1,2,3):\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "complex.remove_star(1,2,3):\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
// verification
BOOST_CHECK(complex.contains_blocker(simplex_123));
@@ -142,13 +142,13 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_collapse1) {
build_complete(4, complex);
complex.add_blocker(Simplex(Vertex_handle(0), Vertex_handle(1), Vertex_handle(2), Vertex_handle(3)));
// Print result
- std::cout << "initial complex :\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "initial complex :\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
Simplex simplex_123(Vertex_handle(1), Vertex_handle(2), Vertex_handle(3));
complex.remove_star(simplex_123);
- std::cout << "complex.remove_star(1,2,3):\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "complex.remove_star(1,2,3):\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
// verification
BOOST_CHECK(complex.contains_blocker(simplex_123));
@@ -164,13 +164,13 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_collapse2) {
complex.add_edge_without_blockers(Vertex_handle(3), Vertex_handle(4));
complex.add_blocker(Simplex(Vertex_handle(1), Vertex_handle(2), Vertex_handle(3), Vertex_handle(4)));
// Print result
- std::cout << "initial complex :\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "initial complex :\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
Simplex sigma(Vertex_handle(1), Vertex_handle(2), Vertex_handle(3));
complex.remove_star(sigma);
- std::cout << "complex.remove_star(1,2,3):\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "complex.remove_star(1,2,3):\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
// verification
BOOST_CHECK(!complex.contains_blocker(Simplex(Vertex_handle(1), Vertex_handle(2),
@@ -187,11 +187,11 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_collapse3) {
complex.add_edge_without_blockers(Vertex_handle(3), Vertex_handle(4));
complex.add_blocker(Simplex(Vertex_handle(1), Vertex_handle(2), Vertex_handle(3), Vertex_handle(4)));
// Print result
- std::cout << "initial complex:\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "initial complex:\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
complex.remove_star(static_cast<Vertex_handle> (2));
- std::cout << "complex after remove star of 2:\n" << complex.to_string();
+ std::clog << "complex after remove star of 2:\n" << complex.to_string();
BOOST_CHECK(complex.contains_blocker(Simplex(Vertex_handle(1), Vertex_handle(3), Vertex_handle(4))));
BOOST_CHECK(!complex.contains_blocker(Simplex(Vertex_handle(1), Vertex_handle(2),
@@ -202,11 +202,11 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_add_simplex) {
Complex complex(4);
build_complete(4, complex);
complex.add_blocker(Simplex(Vertex_handle(0), Vertex_handle(1), Vertex_handle(3)));
- std::cout << "initial complex:\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "initial complex:\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
complex.add_simplex(Simplex(Vertex_handle(0), Vertex_handle(1), Vertex_handle(3)));
- std::cout << "complex after add_simplex:\n" << complex.to_string();
+ std::clog << "complex after add_simplex:\n" << complex.to_string();
BOOST_CHECK(complex.num_blockers() == 1);
BOOST_CHECK(complex.contains_blocker(Simplex(Vertex_handle(0), Vertex_handle(1),
Vertex_handle(2), Vertex_handle(3))));
@@ -216,8 +216,8 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_add_simplex2) {
Complex complex;
build_complete(4, complex);
// Print result
- std::cout << "initial complex:\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "initial complex:\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
Complex copy(complex.num_vertices());
@@ -232,7 +232,7 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_add_simplex2) {
copy.add_simplex(simplex);
}
- std::cout << "complex after add_simplex:\n" << copy.to_string();
+ std::clog << "complex after add_simplex:\n" << copy.to_string();
BOOST_CHECK(complex.num_blockers() == copy.num_blockers());
BOOST_CHECK(complex.num_edges() == copy.num_edges());
@@ -246,11 +246,11 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_add_simplex3) {
Simplex sigma(Vertex_handle(0), Vertex_handle(1), Vertex_handle(2));
complex.add_blocker(sigma);
// Print result
- std::cout << "initial complex:\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "initial complex:\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
complex.add_simplex(sigma);
//should create two blockers 0123 and 0124
- std::cout << "complex after adding simplex 012:\n" << complex.to_string();
+ std::clog << "complex after adding simplex 012:\n" << complex.to_string();
BOOST_CHECK(complex.num_blockers() == 2);
BOOST_CHECK(complex.contains_blocker(Simplex(Vertex_handle(0), Vertex_handle(1),
Vertex_handle(2), Vertex_handle(3))));
@@ -292,11 +292,11 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_add_edge) {
complex.add_edge(Vertex_handle(i), Vertex_handle((i + 1) % 4));
// Print result
- std::cout << "initial complex:\n" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "initial complex:\n" << complex.to_string();
+ std::clog << std::endl << std::endl;
complex.add_edge(Vertex_handle(1), Vertex_handle(3));
//should create two blockers 013 and 012
- std::cout << "complex after adding edge 13:\n" << complex.to_string();
+ std::clog << "complex after adding edge 13:\n" << complex.to_string();
BOOST_CHECK(complex.num_blockers() == 2);
BOOST_CHECK(complex.contains_blocker(Simplex(Vertex_handle(0), Vertex_handle(1), Vertex_handle(3))));
BOOST_CHECK(complex.contains_blocker(Simplex(Vertex_handle(1), Vertex_handle(2), Vertex_handle(3))));
@@ -313,12 +313,12 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_remove_popable_blockers)
complex.add_blocker(sigma1);
complex.add_blocker(sigma2);
- std::cout << "complex complex" << complex.to_string();
- std::cout << std::endl << std::endl;
- std::cout << "complex.RemovePopableBlockers();" << std::endl;
+ std::clog << "complex complex" << complex.to_string();
+ std::clog << std::endl << std::endl;
+ std::clog << "complex.RemovePopableBlockers();" << std::endl;
complex.remove_popable_blockers();
- std::cout << "complex complex" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << "complex complex" << complex.to_string();
+ std::clog << std::endl << std::endl;
BOOST_CHECK(complex.num_blockers() == 1);
@@ -337,12 +337,12 @@ BOOST_AUTO_TEST_CASE(test_skeleton_blocker_simplifiable_remove_popable_blockers)
complex.add_blocker(sigma1);
complex.add_blocker(sigma2);
- std::cout << "complex complex" << complex.to_string();
- std::cout << std::endl << std::endl;
- std::cout << "complex.RemovePopableBlockers();" << std::endl;
+ std::clog << "complex complex" << complex.to_string();
+ std::clog << std::endl << std::endl;
+ std::clog << "complex.RemovePopableBlockers();" << std::endl;
complex.remove_popable_blockers();
- std::cout << "complex complex" << complex.to_string();
+ std::clog << "complex complex" << complex.to_string();
- std::cout << std::endl << std::endl;
+ std::clog << std::endl << std::endl;
BOOST_CHECK(complex.num_blockers() == 0);
}