diff options
author | glisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-03-17 09:24:13 +0000 |
---|---|---|
committer | glisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-03-17 09:24:13 +0000 |
commit | f20d49cc68a0dd352605164a4f41f3b1acc2876b (patch) | |
tree | 20c05bbf05dc4da9f65d3bdf75012f3aa6f92df3 /src/Contraction/example | |
parent | d133f17dede836cee1dfff47d2e00532573b9ead (diff) | |
parent | 258ea460177a77c5d2cb45d623400cef2f7e0833 (diff) |
Merge from trunk.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bitmap@1050 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 1a32dd3528c771a78d5749ac2c04503a3d979fe4
Diffstat (limited to 'src/Contraction/example')
-rw-r--r-- | src/Contraction/example/Garland_heckbert.cpp | 17 | ||||
-rw-r--r-- | src/Contraction/example/Rips_contraction.cpp | 4 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/Contraction/example/Garland_heckbert.cpp b/src/Contraction/example/Garland_heckbert.cpp index 70f29b6a..b545a066 100644 --- a/src/Contraction/example/Garland_heckbert.cpp +++ b/src/Contraction/example/Garland_heckbert.cpp @@ -145,12 +145,13 @@ class GH_visitor : public Gudhi::contraction::Contraction_visitor<EdgeProfile> { int main(int argc, char *argv[]) { if (argc != 4) { - std::cerr << "Usage " << argv[0] << " input.off output.off N to load the file input.off, contract N edges and save " - << "the result to output.off.\n"; + std::cerr << "Usage " << argv[0] << + " input.off output.off N to load the file input.off, contract N edges and save the result to output.off.\n"; return EXIT_FAILURE; } Complex complex; + typedef Complex::Vertex_handle Vertex_handle; // load the points Skeleton_blocker_off_reader<Complex> off_reader(argv[1], complex); @@ -159,8 +160,12 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - std::cout << "Load complex with " << complex.num_vertices() << " vertices" << std::endl; + if (!complex.empty() && !(complex.point(Vertex_handle(0)).dimension() == 3)) { + std::cerr << "Only points of dimension 3 are supported." << std::endl; + return EXIT_FAILURE; + } + std::cout << "Load complex with " << complex.num_vertices() << " vertices" << std::endl; int num_contractions = atoi(argv[3]); @@ -178,7 +183,7 @@ int main(int argc, char *argv[]) { std::cout << "Final complex has " << complex.num_vertices() << " vertices, " << - complex.num_edges() << " edges and" << + complex.num_edges() << " edges and " << complex.num_triangles() << " triangles." << std::endl; // write simplified complex @@ -187,6 +192,8 @@ int main(int argc, char *argv[]) { return EXIT_SUCCESS; } +#endif // GARLAND_HECKBERT_H_ + + -#endif // GARLAND_HECKBERT_H_ diff --git a/src/Contraction/example/Rips_contraction.cpp b/src/Contraction/example/Rips_contraction.cpp index d21246ed..f80cc2dc 100644 --- a/src/Contraction/example/Rips_contraction.cpp +++ b/src/Contraction/example/Rips_contraction.cpp @@ -49,7 +49,7 @@ void build_rips(ComplexType& complex, double offset) { for (auto p = vertices.begin(); p != vertices.end(); ++p) for (auto q = p; ++q != vertices.end(); /**/) { if (squared_dist(complex.point(*p), complex.point(*q)) < 4 * offset * offset) - complex.add_edge(*p, *q); + complex.add_edge_without_blockers(*p, *q); } } @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) { contractor.contract_edges(); std::cout << "Counting final number of simplices \n"; - unsigned num_simplices = std::distance(complex.simplex_range().begin(), complex.simplex_range().end()); + unsigned num_simplices = std::distance(complex.complex_simplex_range().begin(), complex.complex_simplex_range().end()); std::cout << "Final complex has " << complex.num_vertices() << " vertices, " << |