diff options
author | Gard Spreemann <gspr@nonempty.org> | 2020-05-20 08:42:23 +0200 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2020-05-20 08:42:23 +0200 |
commit | 9b3079646ee3f6a494b83e864b3e10b8a93597d0 (patch) | |
tree | 63ecae8cf0d09b72907805e68f19765c7dd9694a /src/GudhUI | |
parent | 81816dae256a9f3c0653b1d21443c3c32da7a974 (diff) | |
parent | 97e889f34e929f3c2306803b6c37b57926bd1245 (diff) |
Merge tag 'tags/gudhi-release-3.2.0' into dfsg/latest
Diffstat (limited to 'src/GudhUI')
-rw-r--r-- | src/GudhUI/model/Model.h | 64 | ||||
-rw-r--r-- | src/GudhUI/utils/Bar_code_persistence.h | 4 | ||||
-rw-r--r-- | src/GudhUI/utils/Critical_points.h | 2 | ||||
-rw-r--r-- | src/GudhUI/utils/Rips_builder.h | 6 | ||||
-rw-r--r-- | src/GudhUI/view/View_parameter.h | 6 |
5 files changed, 41 insertions, 41 deletions
diff --git a/src/GudhUI/model/Model.h b/src/GudhUI/model/Model.h index dd9bdaab..626ef59d 100644 --- a/src/GudhUI/model/Model.h +++ b/src/GudhUI/model/Model.h @@ -60,7 +60,7 @@ class CGAL_geometric_flag_complex_wrapper { void maximal_face(std::vector<int> vertices) { if (!load_only_points_) { - // std::cout << "size:" << vertices.size() << std::endl; + // std::clog << "size:" << vertices.size() << std::endl; for (std::size_t i = 0; i < vertices.size(); ++i) for (std::size_t j = i + 1; j < vertices.size(); ++j) complex_.add_edge_without_blockers(Vertex_handle(vertices[i]), Vertex_handle(vertices[j])); @@ -178,7 +178,7 @@ class Model { void contract_edges(unsigned num_contractions) { Gudhi::Clock c; Edge_contractor<Complex> contractor(complex_, num_contractions); - std::cout << "Time to simplify: " << c.num_seconds() << "s" << std::endl; + std::clog << "Time to simplify: " << c.num_seconds() << "s" << std::endl; } void collapse_vertices(unsigned num_collapses) { @@ -192,14 +192,14 @@ class Model { } void show_graph_stats() { - std::cout << "++++++ Graph stats +++++++" << std::endl; - std::cout << "Num vertices : " << complex_.num_vertices() << std::endl; - std::cout << "Num edges : " << complex_.num_edges() << std::endl; - std::cout << "Num connected components : " << complex_.num_connected_components() << std::endl; - std::cout << "Min/avg/max degree : " << min_degree() << "/" << avg_degree() << "/" << max_degree() << std::endl; - std::cout << "Num connected components : " << complex_.num_connected_components() << std::endl; - std::cout << "Num connected components : " << complex_.num_connected_components() << std::endl; - std::cout << "+++++++++++++++++++++++++" << std::endl; + std::clog << "++++++ Graph stats +++++++" << std::endl; + std::clog << "Num vertices : " << complex_.num_vertices() << std::endl; + std::clog << "Num edges : " << complex_.num_edges() << std::endl; + std::clog << "Num connected components : " << complex_.num_connected_components() << std::endl; + std::clog << "Min/avg/max degree : " << min_degree() << "/" << avg_degree() << "/" << max_degree() << std::endl; + std::clog << "Num connected components : " << complex_.num_connected_components() << std::endl; + std::clog << "Num connected components : " << complex_.num_connected_components() << std::endl; + std::clog << "+++++++++++++++++++++++++" << std::endl; } private: @@ -226,11 +226,11 @@ class Model { public: void show_complex_stats() { - std::cout << "++++++ Mesh stats +++++++" << std::endl; - std::cout << "Num vertices : " << complex_.num_vertices() << std::endl; - std::cout << "Num edges : " << complex_.num_edges() << std::endl; - std::cout << "Num connected components : " << complex_.num_connected_components() << std::endl; - std::cout << "+++++++++++++++++++++++++" << std::endl; + std::clog << "++++++ Mesh stats +++++++" << std::endl; + std::clog << "Num vertices : " << complex_.num_vertices() << std::endl; + std::clog << "Num edges : " << complex_.num_edges() << std::endl; + std::clog << "Num connected components : " << complex_.num_connected_components() << std::endl; + std::clog << "+++++++++++++++++++++++++" << std::endl; } void show_complex_dimension() { @@ -247,18 +247,18 @@ class Model { euler -= 1; } clock.end(); - std::cout << "++++++ Mesh dimension +++++++" << std::endl; - std::cout << "Dimension : " << dimension << std::endl; - std::cout << "Euler characteristic : " << euler << std::endl; - std::cout << "Num simplices : " << num_simplices << std::endl; - std::cout << "Total time: " << clock << std::endl; - std::cout << "Time per simplex: " << clock.num_seconds() / num_simplices << " s" << std::endl; - std::cout << "+++++++++++++++++++++++++" << std::endl; + std::clog << "++++++ Mesh dimension +++++++" << std::endl; + std::clog << "Dimension : " << dimension << std::endl; + std::clog << "Euler characteristic : " << euler << std::endl; + std::clog << "Num simplices : " << num_simplices << std::endl; + std::clog << "Total time: " << clock << std::endl; + std::clog << "Time per simplex: " << clock.num_seconds() / num_simplices << " s" << std::endl; + std::clog << "+++++++++++++++++++++++++" << std::endl; } void show_homology_group() { #ifdef _WIN32 - std::cout << "Works only on linux x64 for the moment\n"; + std::clog << "Works only on linux x64 for the moment\n"; #else Gudhi::Clock clock; run_chomp(); @@ -278,16 +278,16 @@ class Model { else euler -= 1; } - std::cout << "Saw " << num_simplices << " simplices with maximum dimension " << dimension << std::endl; - std::cout << "The euler characteristic is : " << euler << std::endl; + std::clog << "Saw " << num_simplices << " simplices with maximum dimension " << dimension << std::endl; + std::clog << "The euler characteristic is : " << euler << std::endl; } void show_persistence(int p, double threshold, int max_dim, double min_pers) { - Persistence_compute<Complex> persistence(complex_, std::cout, Persistence_params(p, threshold, max_dim, min_pers)); + Persistence_compute<Complex> persistence(complex_, std::clog, Persistence_params(p, threshold, max_dim, min_pers)); } void show_critical_points(double max_distance) { - Critical_points<Complex> critical_points(complex_, std::cout, max_distance); + Critical_points<Complex> critical_points(complex_, std::clog, max_distance); } void show_is_manifold() { @@ -296,12 +296,12 @@ class Model { Is_manifold<Complex> test_manifold(complex_, dim, is_manifold); if (is_manifold) { - std::cout << "The complex is a " << dim << "-manifold\n"; + std::clog << "The complex is a " << dim << "-manifold\n"; } else { if (dim < 4) { - std::cout << "The complex has dimension greater than " << dim << " and is not a manifold\n"; + std::clog << "The complex has dimension greater than " << dim << " and is not a manifold\n"; } else { - std::cout << "The complex has dimension>=4 and may or may not be a manifold\n"; + std::clog << "The complex has dimension>=4 and may or may not be a manifold\n"; } } } @@ -309,10 +309,10 @@ class Model { private: void run_chomp() { save_complex_in_file_for_chomp(); - std::cout << "Call CHOMP library\n"; + std::clog << "Call CHOMP library\n"; int returnValue = system("homsimpl chomp.sim"); if (returnValue != 0) { - std::cout << "homsimpl (from CHOMP) failed. Please check it is installed or available in the PATH." + std::cerr << "homsimpl (from CHOMP) failed. Please check it is installed or available in the PATH." << std::endl; } } diff --git a/src/GudhUI/utils/Bar_code_persistence.h b/src/GudhUI/utils/Bar_code_persistence.h index cd9b009f..b526017a 100644 --- a/src/GudhUI/utils/Bar_code_persistence.h +++ b/src/GudhUI/utils/Bar_code_persistence.h @@ -58,13 +58,13 @@ class Bar_code_persistence { QGraphicsScene * scene = new QGraphicsScene(); view->setScene(scene); double ratio = 600.0 / (max_death - min_birth); - // std::cout << "min_birth=" << min_birth << " - max_death=" << max_death << " - ratio=" << ratio << std::endl; + // std::clog << "min_birth=" << min_birth << " - max_death=" << max_death << " - ratio=" << ratio << std::endl; double height = 0.0, birth = 0.0, death = 0.0; int pers_num = 1; for (auto& persistence : persistence_vector) { height = 5.0 * pers_num; - // std::cout << "[" << pers_num << "] birth=" << persistence.first << " - death=" << persistence.second << std::endl; + // std::clog << "[" << pers_num << "] birth=" << persistence.first << " - death=" << persistence.second << std::endl; if (std::isfinite(persistence.first)) birth = ((persistence.first - min_birth) * ratio) + 50.0; else diff --git a/src/GudhUI/utils/Critical_points.h b/src/GudhUI/utils/Critical_points.h index 32fcf32e..97e58737 100644 --- a/src/GudhUI/utils/Critical_points.h +++ b/src/GudhUI/utils/Critical_points.h @@ -65,7 +65,7 @@ template<typename SkBlComplex> class Critical_points { void anti_collapse_edges(const std::deque<Edge>& edges) { unsigned pos = 0; for (Edge e : edges) { - std::cout << "edge " << pos++ << "/" << edges.size() << "\n"; + std::clog << "edge " << pos++ << "/" << edges.size() << "\n"; auto eh = filled_complex_.add_edge_without_blockers(e.first, e.second); int is_contractible(is_link_reducible(eh)); diff --git a/src/GudhUI/utils/Rips_builder.h b/src/GudhUI/utils/Rips_builder.h index aba1a8e4..0300190c 100644 --- a/src/GudhUI/utils/Rips_builder.h +++ b/src/GudhUI/utils/Rips_builder.h @@ -43,13 +43,13 @@ template<typename SkBlComplex> class Rips_builder { void compute_edges(double alpha) { auto vertices = complex_.vertex_range(); for (auto p = vertices.begin(); p != vertices.end(); ++p) { - std::cout << *p << " "; - std::cout.flush(); + std::clog << *p << " "; + std::clog.flush(); for (auto q = p; ++q != vertices.end(); /**/) if (squared_eucl_distance(complex_.point(*p), complex_.point(*q)) < 4 * alpha * alpha) complex_.add_edge_without_blockers(*p, *q); } - std::cout << std::endl; + std::clog << std::endl; } }; diff --git a/src/GudhUI/view/View_parameter.h b/src/GudhUI/view/View_parameter.h index dfd3aa41..3671f4fb 100644 --- a/src/GudhUI/view/View_parameter.h +++ b/src/GudhUI/view/View_parameter.h @@ -52,13 +52,13 @@ class View_parameter { void change_vertex_mode() { int current_value = vertex_mode; vertex_mode = static_cast<VERTEX_MODE> (++current_value % V_COUNT); - std::cout << "Vertex mode : "; + std::clog << "Vertex mode : "; switch (vertex_mode) { case V_NONE: - std::cout << "empty\n"; + std::clog << "empty\n"; break; case V_SIMPLE: - std::cout << "simple\n"; + std::clog << "simple\n"; break; default: break; |