From 4b7ea5b88dc96ca3d5a881ea7962a0accbd9a62a Mon Sep 17 00:00:00 2001 From: glisse Date: Thu, 30 Nov 2017 15:39:50 +0000 Subject: map::insert(pair(a,b)) --> map::emplace(a,b) git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/misc-glisse@2990 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: ae232890c6291e2e381b0d76f21b2a66da2cf9f5 --- src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index 0a021a0f..ff834393 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -168,7 +168,7 @@ int main(int argc, char **argv) { std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] not found - insert " << vertex << std::endl; #endif // DEBUG_TRACES the_simplex_tree.push_back(vertex); - map_cgal_simplex_tree.insert(Alpha_shape_simplex_tree_pair(the_alpha_shape_vertex, vertex)); + map_cgal_simplex_tree.emplace(the_alpha_shape_vertex, vertex); } else { // alpha shape found Simplex_tree_vertex vertex = the_map_iterator->second; -- cgit v1.2.3 From 0a0b42dc45ddcc5065cf70dc05e7070ce09eeff5 Mon Sep 17 00:00:00 2001 From: glisse Date: Thu, 30 Nov 2017 15:41:18 +0000 Subject: dead typedef git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/misc-glisse@2991 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a314bb92443fc49370a7e12da84713eed7985981 --- src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp | 1 - src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp | 1 - src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp | 1 - src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp | 1 - .../utilities/weighted_periodic_alpha_complex_3d_persistence.cpp | 1 - 5 files changed, 5 deletions(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index ff834393..7470d7df 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -73,7 +73,6 @@ using ST = Gudhi::Simplex_tree; using Filtration_value = ST::Filtration_value; using Simplex_tree_vertex = ST::Vertex_handle; using Alpha_shape_simplex_tree_map = std::map; -using Alpha_shape_simplex_tree_pair = std::pair; using Simplex_tree_vector_vertex = std::vector; using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology; diff --git a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp index fc9d1a8a..eb0f4b62 100644 --- a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp @@ -74,7 +74,6 @@ using ST = Gudhi::Simplex_tree; using Filtration_value = ST::Filtration_value; using Simplex_tree_vertex = ST::Vertex_handle; using Alpha_shape_simplex_tree_map = std::map; -using Alpha_shape_simplex_tree_pair = std::pair; using Simplex_tree_vector_vertex = std::vector; using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology; diff --git a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp index 2f544076..5e6ff873 100644 --- a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp @@ -79,7 +79,6 @@ using ST = Gudhi::Simplex_tree; using Filtration_value = ST::Filtration_value; using Simplex_tree_vertex = ST::Vertex_handle; using Alpha_shape_simplex_tree_map = std::map; -using Alpha_shape_simplex_tree_pair = std::pair; using Simplex_tree_vector_vertex = std::vector; using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology; diff --git a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp index 6e0074e1..2e42c99f 100644 --- a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp @@ -99,7 +99,6 @@ using ST = Gudhi::Simplex_tree; using Filtration_value = ST::Filtration_value; using Simplex_tree_vertex = ST::Vertex_handle; using Alpha_shape_simplex_tree_map = std::map; -using Alpha_shape_simplex_tree_pair = std::pair; using Simplex_tree_vector_vertex = std::vector; using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology; diff --git a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp index 5958ff3a..2f3aa509 100644 --- a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp @@ -81,7 +81,6 @@ using ST = Gudhi::Simplex_tree; using Filtration_value = ST::Filtration_value; using Simplex_tree_vertex = ST::Vertex_handle; using Alpha_shape_simplex_tree_map = std::map; -using Alpha_shape_simplex_tree_pair = std::pair; using Simplex_tree_vector_vertex = std::vector; using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology; -- cgit v1.2.3 From d50e2735c2503038652eb8f225e2badcc3821239 Mon Sep 17 00:00:00 2001 From: glisse Date: Thu, 30 Nov 2017 15:43:26 +0000 Subject: remove dim_max git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/misc-glisse@2992 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 8d511d55de65a316b2c83a6763c90ef2bc26942f --- .../utilities/alpha_complex_3d_persistence.cpp | 13 ------------- .../utilities/exact_alpha_complex_3d_persistence.cpp | 13 ------------- .../utilities/periodic_alpha_complex_3d_persistence.cpp | 13 ------------- .../utilities/weighted_alpha_complex_3d_persistence.cpp | 13 ------------- .../weighted_periodic_alpha_complex_3d_persistence.cpp | 13 ------------- 5 files changed, 65 deletions(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index 7470d7df..d0920689 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -127,31 +127,18 @@ int main(int argc, char **argv) { ST simplex_tree; Alpha_shape_simplex_tree_map map_cgal_simplex_tree; std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); - int dim_max = 0; Filtration_value filtration_max = 0.0; for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { vertex_list = from_cell(*cell); count_cells++; - if (dim_max < 3) { - // Cell is of dim 3 - dim_max = 3; - } } else if (const Facet* facet = CGAL::object_cast(&object_iterator)) { vertex_list = from_facet(*facet); count_facets++; - if (dim_max < 2) { - // Facet is of dim 2 - dim_max = 2; - } } else if (const Edge_3* edge = CGAL::object_cast(&object_iterator)) { vertex_list = from_edge(*edge); count_edges++; - if (dim_max < 1) { - // Edge_3 is of dim 1 - dim_max = 1; - } } else if (const Vertex_handle* vertex = CGAL::object_cast(&object_iterator)) { count_vertices++; vertex_list = from_vertex(*vertex); diff --git a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp index eb0f4b62..877507fa 100644 --- a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp @@ -128,31 +128,18 @@ int main(int argc, char **argv) { ST simplex_tree; Alpha_shape_simplex_tree_map map_cgal_simplex_tree; std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); - int dim_max = 0; Filtration_value filtration_max = 0.0; for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { vertex_list = from_cell(*cell); count_cells++; - if (dim_max < 3) { - // Cell is of dim 3 - dim_max = 3; - } } else if (const Facet* facet = CGAL::object_cast(&object_iterator)) { vertex_list = from_facet(*facet); count_facets++; - if (dim_max < 2) { - // Facet is of dim 2 - dim_max = 2; - } } else if (const Edge_3* edge = CGAL::object_cast(&object_iterator)) { vertex_list = from_edge(*edge); count_edges++; - if (dim_max < 1) { - // Edge_3 is of dim 1 - dim_max = 1; - } } else if (const Vertex_handle* vertex = CGAL::object_cast(&object_iterator)) { count_vertices++; vertex_list = from_vertex(*vertex); diff --git a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp index 5e6ff873..8e7e5090 100644 --- a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp @@ -151,31 +151,18 @@ int main(int argc, char **argv) { ST simplex_tree; Alpha_shape_simplex_tree_map map_cgal_simplex_tree; std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); - int dim_max = 0; Filtration_value filtration_max = 0.0; for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { vertex_list = from_cell(*cell); count_cells++; - if (dim_max < 3) { - // Cell is of dim 3 - dim_max = 3; - } } else if (const Facet* facet = CGAL::object_cast(&object_iterator)) { vertex_list = from_facet(*facet); count_facets++; - if (dim_max < 2) { - // Facet is of dim 2 - dim_max = 2; - } } else if (const Edge_3* edge = CGAL::object_cast(&object_iterator)) { vertex_list = from_edge(*edge); count_edges++; - if (dim_max < 1) { - // Edge_3 is of dim 1 - dim_max = 1; - } } else if (const Vertex_handle* vertex = CGAL::object_cast(&object_iterator)) { count_vertices++; vertex_list = from_vertex(*vertex); diff --git a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp index 2e42c99f..4ee91cd3 100644 --- a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp @@ -176,31 +176,18 @@ int main(int argc, char **argv) { ST simplex_tree; Alpha_shape_simplex_tree_map map_cgal_simplex_tree; std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); - int dim_max = 0; Filtration_value filtration_max = 0.0; for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { vertex_list = from_cell(*cell); count_cells++; - if (dim_max < 3) { - // Cell is of dim 3 - dim_max = 3; - } } else if (const Facet* facet = CGAL::object_cast(&object_iterator)) { vertex_list = from_facet(*facet); count_facets++; - if (dim_max < 2) { - // Facet is of dim 2 - dim_max = 2; - } } else if (const Edge_3* edge = CGAL::object_cast(&object_iterator)) { vertex_list = from_edge(*edge); count_edges++; - if (dim_max < 1) { - // Edge_3 is of dim 1 - dim_max = 1; - } } else if (const Vertex_handle* vertex = CGAL::object_cast(&object_iterator)) { count_vertices++; vertex_list = from_vertex(*vertex); diff --git a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp index 2f3aa509..8050dc65 100644 --- a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp @@ -179,31 +179,18 @@ int main(int argc, char* const argv[]) { ST simplex_tree; Alpha_shape_simplex_tree_map map_cgal_simplex_tree; std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); - int dim_max = 0; Filtration_value filtration_max = 0.0; for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { vertex_list = from_cell(*cell); count_cells++; - if (dim_max < 3) { - // Cell is of dim 3 - dim_max = 3; - } } else if (const Facet* facet = CGAL::object_cast(&object_iterator)) { vertex_list = from_facet(*facet); count_facets++; - if (dim_max < 2) { - // Facet is of dim 2 - dim_max = 2; - } } else if (const Edge_3* edge = CGAL::object_cast(&object_iterator)) { vertex_list = from_edge(*edge); count_edges++; - if (dim_max < 1) { - // Edge_3 is of dim 1 - dim_max = 1; - } } else if (const Vertex_handle* vertex = CGAL::object_cast(&object_iterator)) { count_vertices++; vertex_list = from_vertex(*vertex); -- cgit v1.2.3 From a76511c25d45aa9cadf3b4e9150dbbc4f0e7dc4f Mon Sep 17 00:00:00 2001 From: glisse Date: Thu, 30 Nov 2017 15:44:34 +0000 Subject: remove filtration_max git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/misc-glisse@2993 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 99113f763adb76266bb2dad206bce539076c3f62 --- src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp | 4 ---- src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp | 4 ---- src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp | 4 ---- src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp | 4 ---- .../utilities/weighted_periodic_alpha_complex_3d_persistence.cpp | 4 ---- 5 files changed, 20 deletions(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index d0920689..24492802 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -127,7 +127,6 @@ int main(int argc, char **argv) { ST simplex_tree; Alpha_shape_simplex_tree_map map_cgal_simplex_tree; std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); - Filtration_value filtration_max = 0.0; for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { @@ -169,9 +168,6 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES - if (filtr > filtration_max) { - filtration_max = filtr; - } simplex_tree.insert_simplex(the_simplex_tree, filtr); if (the_alpha_value_iterator != the_alpha_values.end()) ++the_alpha_value_iterator; diff --git a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp index 877507fa..7519e25f 100644 --- a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp @@ -128,7 +128,6 @@ int main(int argc, char **argv) { ST simplex_tree; Alpha_shape_simplex_tree_map map_cgal_simplex_tree; std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); - Filtration_value filtration_max = 0.0; for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { @@ -171,9 +170,6 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES - if (filtr > filtration_max) { - filtration_max = filtr; - } simplex_tree.insert_simplex(the_simplex_tree, filtr); if (the_alpha_value_iterator != the_alpha_values.end()) ++the_alpha_value_iterator; diff --git a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp index 8e7e5090..f751d5f6 100644 --- a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp @@ -151,7 +151,6 @@ int main(int argc, char **argv) { ST simplex_tree; Alpha_shape_simplex_tree_map map_cgal_simplex_tree; std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); - Filtration_value filtration_max = 0.0; for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { @@ -193,9 +192,6 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES - if (filtr > filtration_max) { - filtration_max = filtr; - } simplex_tree.insert_simplex(the_simplex_tree, filtr); if (the_alpha_value_iterator != the_alpha_values.end()) ++the_alpha_value_iterator; diff --git a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp index 4ee91cd3..51f4a60b 100644 --- a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp @@ -176,7 +176,6 @@ int main(int argc, char **argv) { ST simplex_tree; Alpha_shape_simplex_tree_map map_cgal_simplex_tree; std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); - Filtration_value filtration_max = 0.0; for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { @@ -218,9 +217,6 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES - if (filtr > filtration_max) { - filtration_max = filtr; - } simplex_tree.insert_simplex(the_simplex_tree, filtr); if (the_alpha_value_iterator != the_alpha_values.end()) ++the_alpha_value_iterator; diff --git a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp index 8050dc65..24e0b665 100644 --- a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp @@ -179,7 +179,6 @@ int main(int argc, char* const argv[]) { ST simplex_tree; Alpha_shape_simplex_tree_map map_cgal_simplex_tree; std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); - Filtration_value filtration_max = 0.0; for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { @@ -221,9 +220,6 @@ int main(int argc, char* const argv[]) { #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES - if (filtr > filtration_max) { - filtration_max = filtr; - } simplex_tree.insert_simplex(the_simplex_tree, filtr); if (the_alpha_value_iterator != the_alpha_values.end()) ++the_alpha_value_iterator; -- cgit v1.2.3 From 7b29ed7cea21e87a0b8c876c52ca525245161dfd Mon Sep 17 00:00:00 2001 From: glisse Date: Thu, 30 Nov 2017 15:47:29 +0000 Subject: list -> vector git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/misc-glisse@2994 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 336af6c51d9b6ca4d60b2caac02a3f53b02ffda5 --- src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp | 3 +-- src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp | 3 +-- src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp | 3 +-- src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp | 3 +-- .../utilities/weighted_periodic_alpha_complex_3d_persistence.cpp | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index 24492802..aef1151e 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -66,7 +65,7 @@ using Cell_handle = Alpha_shape_3::Cell_handle; using Facet = Alpha_shape_3::Facet; using Edge_3 = Alpha_shape_3::Edge; using Vertex_handle = Alpha_shape_3::Vertex_handle; -using Vertex_list = std::list; +using Vertex_list = std::vector; // gudhi type definition using ST = Gudhi::Simplex_tree; diff --git a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp index 7519e25f..d53f72c7 100644 --- a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -67,7 +66,7 @@ using Cell_handle = Alpha_shape_3::Cell_handle; using Facet = Alpha_shape_3::Facet; using Edge_3 = Alpha_shape_3::Edge; using Vertex_handle = Alpha_shape_3::Vertex_handle; -using Vertex_list = std::list; +using Vertex_list = std::vector; // gudhi type definition using ST = Gudhi::Simplex_tree; diff --git a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp index f751d5f6..b58480ee 100644 --- a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include @@ -72,7 +71,7 @@ using Cell_handle = Alpha_shape_3::Cell_handle; using Facet = Alpha_shape_3::Facet; using Edge_3 = Alpha_shape_3::Edge; using Vertex_handle = Alpha_shape_3::Vertex_handle; -using Vertex_list = std::list; +using Vertex_list = std::vector; // gudhi type definition using ST = Gudhi::Simplex_tree; diff --git a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp index 51f4a60b..4a54583a 100644 --- a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include #include @@ -92,7 +91,7 @@ using Cell_handle = Alpha_shape_3::Cell_handle; using Facet = Alpha_shape_3::Facet; using Edge_3 = Alpha_shape_3::Edge; using Vertex_handle = Alpha_shape_3::Vertex_handle; -using Vertex_list = std::list; +using Vertex_list = std::vector; // gudhi type definition using ST = Gudhi::Simplex_tree; diff --git a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp index 24e0b665..7221d12d 100644 --- a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -74,7 +73,7 @@ using Cell_handle = Alpha_shape_3::Cell_handle; using Facet = Alpha_shape_3::Facet; using Edge_3 = Alpha_shape_3::Edge; using Vertex_handle = Alpha_shape_3::Vertex_handle; -using Vertex_list = std::list; +using Vertex_list = std::vector; // gudhi type definition using ST = Gudhi::Simplex_tree; -- cgit v1.2.3 From 28d6d8aec8f3e1c91bf2a3fdd024d3a471717630 Mon Sep 17 00:00:00 2001 From: glisse Date: Thu, 30 Nov 2017 15:58:59 +0000 Subject: rename the_simplex_tree which represents one simplex git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/misc-glisse@2996 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fae071018b07c2a3304d14038b6778da0589bf05 --- src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp | 8 ++++---- .../utilities/exact_alpha_complex_3d_persistence.cpp | 8 ++++---- .../utilities/periodic_alpha_complex_3d_persistence.cpp | 8 ++++---- .../utilities/weighted_alpha_complex_3d_persistence.cpp | 8 ++++---- .../utilities/weighted_periodic_alpha_complex_3d_persistence.cpp | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index aef1151e..ada67898 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -142,7 +142,7 @@ int main(int argc, char **argv) { vertex_list = from_vertex(*vertex); } // Construction of the vector of simplex_tree vertex from list of alpha_shapes vertex - Simplex_tree_vector_vertex the_simplex_tree; + Simplex_tree_vector_vertex the_simplex; for (auto the_alpha_shape_vertex : vertex_list) { Alpha_shape_simplex_tree_map::iterator the_map_iterator = map_cgal_simplex_tree.find(the_alpha_shape_vertex); if (the_map_iterator == map_cgal_simplex_tree.end()) { @@ -151,7 +151,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] not found - insert " << vertex << std::endl; #endif // DEBUG_TRACES - the_simplex_tree.push_back(vertex); + the_simplex.push_back(vertex); map_cgal_simplex_tree.emplace(the_alpha_shape_vertex, vertex); } else { // alpha shape found @@ -159,7 +159,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] found in " << vertex << std::endl; #endif // DEBUG_TRACES - the_simplex_tree.push_back(vertex); + the_simplex.push_back(vertex); } } // Construction of the simplex_tree @@ -167,7 +167,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES - simplex_tree.insert_simplex(the_simplex_tree, filtr); + simplex_tree.insert_simplex(the_simplex, filtr); if (the_alpha_value_iterator != the_alpha_values.end()) ++the_alpha_value_iterator; else diff --git a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp index d53f72c7..f55bac20 100644 --- a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp @@ -143,7 +143,7 @@ int main(int argc, char **argv) { vertex_list = from_vertex(*vertex); } // Construction of the vector of simplex_tree vertex from list of alpha_shapes vertex - Simplex_tree_vector_vertex the_simplex_tree; + Simplex_tree_vector_vertex the_simplex; for (auto the_alpha_shape_vertex : vertex_list) { Alpha_shape_simplex_tree_map::iterator the_map_iterator = map_cgal_simplex_tree.find(the_alpha_shape_vertex); if (the_map_iterator == map_cgal_simplex_tree.end()) { @@ -152,7 +152,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] not found - insert " << vertex << std::endl; #endif // DEBUG_TRACES - the_simplex_tree.push_back(vertex); + the_simplex.push_back(vertex); map_cgal_simplex_tree.emplace(the_alpha_shape_vertex, vertex); } else { // alpha shape found @@ -160,7 +160,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] found in " << vertex << std::endl; #endif // DEBUG_TRACES - the_simplex_tree.push_back(vertex); + the_simplex.push_back(vertex); } } // Construction of the simplex_tree @@ -169,7 +169,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES - simplex_tree.insert_simplex(the_simplex_tree, filtr); + simplex_tree.insert_simplex(the_simplex, filtr); if (the_alpha_value_iterator != the_alpha_values.end()) ++the_alpha_value_iterator; else diff --git a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp index b58480ee..a02ccfff 100644 --- a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp @@ -166,7 +166,7 @@ int main(int argc, char **argv) { vertex_list = from_vertex(*vertex); } // Construction of the vector of simplex_tree vertex from list of alpha_shapes vertex - Simplex_tree_vector_vertex the_simplex_tree; + Simplex_tree_vector_vertex the_simplex; for (auto the_alpha_shape_vertex : vertex_list) { Alpha_shape_simplex_tree_map::iterator the_map_iterator = map_cgal_simplex_tree.find(the_alpha_shape_vertex); if (the_map_iterator == map_cgal_simplex_tree.end()) { @@ -175,7 +175,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] not found - insert " << vertex << std::endl; #endif // DEBUG_TRACES - the_simplex_tree.push_back(vertex); + the_simplex.push_back(vertex); map_cgal_simplex_tree.emplace(the_alpha_shape_vertex, vertex); } else { // alpha shape found @@ -183,7 +183,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] found in " << vertex << std::endl; #endif // DEBUG_TRACES - the_simplex_tree.push_back(vertex); + the_simplex.push_back(vertex); } } // Construction of the simplex_tree @@ -191,7 +191,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES - simplex_tree.insert_simplex(the_simplex_tree, filtr); + simplex_tree.insert_simplex(the_simplex, filtr); if (the_alpha_value_iterator != the_alpha_values.end()) ++the_alpha_value_iterator; else diff --git a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp index 4a54583a..d6e5b789 100644 --- a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp @@ -191,7 +191,7 @@ int main(int argc, char **argv) { vertex_list = from_vertex(*vertex); } // Construction of the vector of simplex_tree vertex from list of alpha_shapes vertex - Simplex_tree_vector_vertex the_simplex_tree; + Simplex_tree_vector_vertex the_simplex; for (auto the_alpha_shape_vertex : vertex_list) { Alpha_shape_simplex_tree_map::iterator the_map_iterator = map_cgal_simplex_tree.find(the_alpha_shape_vertex); if (the_map_iterator == map_cgal_simplex_tree.end()) { @@ -200,7 +200,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] not found - insert " << vertex << std::endl; #endif // DEBUG_TRACES - the_simplex_tree.push_back(vertex); + the_simplex.push_back(vertex); map_cgal_simplex_tree.emplace(the_alpha_shape_vertex, vertex); } else { // alpha shape found @@ -208,7 +208,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] found in " << vertex << std::endl; #endif // DEBUG_TRACES - the_simplex_tree.push_back(vertex); + the_simplex.push_back(vertex); } } // Construction of the simplex_tree @@ -216,7 +216,7 @@ int main(int argc, char **argv) { #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES - simplex_tree.insert_simplex(the_simplex_tree, filtr); + simplex_tree.insert_simplex(the_simplex, filtr); if (the_alpha_value_iterator != the_alpha_values.end()) ++the_alpha_value_iterator; else diff --git a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp index 7221d12d..3d4c456d 100644 --- a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp @@ -194,7 +194,7 @@ int main(int argc, char* const argv[]) { vertex_list = from_vertex(*vertex); } // Construction of the vector of simplex_tree vertex from list of alpha_shapes vertex - Simplex_tree_vector_vertex the_simplex_tree; + Simplex_tree_vector_vertex the_simplex; for (auto the_alpha_shape_vertex : vertex_list) { Alpha_shape_simplex_tree_map::iterator the_map_iterator = map_cgal_simplex_tree.find(the_alpha_shape_vertex); if (the_map_iterator == map_cgal_simplex_tree.end()) { @@ -203,7 +203,7 @@ int main(int argc, char* const argv[]) { #ifdef DEBUG_TRACES std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] not found - insert " << vertex << std::endl; #endif // DEBUG_TRACES - the_simplex_tree.push_back(vertex); + the_simplex.push_back(vertex); map_cgal_simplex_tree.emplace(the_alpha_shape_vertex, vertex); } else { // alpha shape found @@ -211,7 +211,7 @@ int main(int argc, char* const argv[]) { #ifdef DEBUG_TRACES std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] found in " << vertex << std::endl; #endif // DEBUG_TRACES - the_simplex_tree.push_back(vertex); + the_simplex.push_back(vertex); } } // Construction of the simplex_tree @@ -219,7 +219,7 @@ int main(int argc, char* const argv[]) { #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES - simplex_tree.insert_simplex(the_simplex_tree, filtr); + simplex_tree.insert_simplex(the_simplex, filtr); if (the_alpha_value_iterator != the_alpha_values.end()) ++the_alpha_value_iterator; else -- cgit v1.2.3 From 15039a6e2ef84b8d79e9d3e912edf901bab40238 Mon Sep 17 00:00:00 2001 From: glisse Date: Thu, 30 Nov 2017 16:01:22 +0000 Subject: Typo get_point_cloud retrieves the points, not the triangulation. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/misc-glisse@2998 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: acc15d17d9ebf9cb3e64c8c66e756cdd8627d137 --- src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp | 2 +- src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp | 2 +- src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp | 2 +- src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp | 2 +- .../utilities/weighted_periodic_alpha_complex_3d_persistence.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index ada67898..3c51cf86 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -95,7 +95,7 @@ int main(int argc, char **argv) { exit(-1); } - // Retrieve the triangulation + // Retrieve the points std::vector lp = off_reader.get_point_cloud(); // alpha shape construction from points. CGAL has a strange behavior in REGULARIZED mode. diff --git a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp index f55bac20..3b9a2ae0 100644 --- a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp @@ -96,7 +96,7 @@ int main(int argc, char **argv) { exit(-1); } - // Retrieve the triangulation + // Retrieve the points std::vector lp = off_reader.get_point_cloud(); // alpha shape construction from points. CGAL has a strange behavior in REGULARIZED mode. diff --git a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp index a02ccfff..6993b0ad 100644 --- a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp @@ -113,7 +113,7 @@ int main(int argc, char **argv) { exit(-1); } - // Retrieve the triangulation + // Retrieve the points std::vector lp = off_reader.get_point_cloud(); // Define the periodic cube diff --git a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp index d6e5b789..f46f1a58 100644 --- a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp @@ -123,7 +123,7 @@ int main(int argc, char **argv) { exit(-1); } - // Retrieve the triangulation + // Retrieve the points std::vector lp = off_reader.get_point_cloud(); // Read weights information from file diff --git a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp index 3d4c456d..282b9180 100644 --- a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp @@ -110,7 +110,7 @@ int main(int argc, char* const argv[]) { usage(argv[0]); } - // Retrieve the triangulation + // Retrieve the points std::vector lp = off_reader.get_point_cloud(); // Read weights information from file -- cgit v1.2.3 From 5e05e851666daa75d96780f194faecc2f6ada6ca Mon Sep 17 00:00:00 2001 From: glisse Date: Thu, 30 Nov 2017 16:12:02 +0000 Subject: Better than vector, static_vector. Too lazy to change the others, there is way too much code shared between these utilities, we will have to factorize the code when moving it to a module. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/misc-glisse@2999 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 92a3d859118619f3a0692f75946c43a4a11f91fc --- src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index 3c51cf86..d839ea19 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -65,7 +66,7 @@ using Cell_handle = Alpha_shape_3::Cell_handle; using Facet = Alpha_shape_3::Facet; using Edge_3 = Alpha_shape_3::Edge; using Vertex_handle = Alpha_shape_3::Vertex_handle; -using Vertex_list = std::vector; +using Vertex_list = boost::container::static_vector; // gudhi type definition using ST = Gudhi::Simplex_tree; -- cgit v1.2.3 From ea60fe8e63b7bb459cf80e2d5614e02b8590952e Mon Sep 17 00:00:00 2001 From: glisse Date: Thu, 30 Nov 2017 16:17:51 +0000 Subject: "This shall not happen": that's what assert is for. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/misc-glisse@3000 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 072f467bf3086b8e014c54c059f67dbd4f563ad7 --- src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index d839ea19..f4a14ae3 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -169,10 +169,9 @@ int main(int argc, char **argv) { std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES simplex_tree.insert_simplex(the_simplex, filtr); - if (the_alpha_value_iterator != the_alpha_values.end()) - ++the_alpha_value_iterator; - else - std::cout << "This shall not happen" << std::endl; + GUDHI_CHECK(the_alpha_value_iterator != the_alpha_values.end(), + "CGAL provided more simplices than values"); + ++the_alpha_value_iterator; } #ifdef DEBUG_TRACES -- cgit v1.2.3 From dc8a8693966e8a6db45b0d9f142d3ff8e3da7c7f Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 19 Dec 2017 21:06:34 +0000 Subject: Boost minimal version is 1.48.0 (modification rollback) - if boost_version use static_vector (from Boost 1.54.0) git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3090 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 487d902c645793f2647191a0d8f9218184fa19de --- src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp | 9 +++++++++ src/cmake/modules/GUDHI_third_party_libraries.cmake | 2 +- src/common/doc/main_page.h | 2 +- src/cython/doc/installation.rst | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index f4a14ae3..1070d17b 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -20,9 +20,13 @@ * along with this program. If not, see . */ +#include #include #include + +#if BOOST_VERSION >= 105400 #include +#endif #include #include @@ -66,7 +70,12 @@ using Cell_handle = Alpha_shape_3::Cell_handle; using Facet = Alpha_shape_3::Facet; using Edge_3 = Alpha_shape_3::Edge; using Vertex_handle = Alpha_shape_3::Vertex_handle; + +#if BOOST_VERSION >= 105400 using Vertex_list = boost::container::static_vector; +#else +using Vertex_list = std::vector; +#endif // gudhi type definition using ST = Gudhi::Simplex_tree; diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake index 7696496c..84545f18 100644 --- a/src/cmake/modules/GUDHI_third_party_libraries.cmake +++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake @@ -1,6 +1,6 @@ # This files manage third party libraries required by GUDHI -find_package(Boost 1.56.0 REQUIRED COMPONENTS system filesystem unit_test_framework program_options thread) +find_package(Boost 1.48.0 REQUIRED COMPONENTS system filesystem unit_test_framework program_options thread) if(NOT Boost_FOUND) message(FATAL_ERROR "NOTICE: This program requires Boost and will not be compiled.") diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index 7ba8a4b7..148ee670 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -258,7 +258,7 @@ * Examples of GUDHI headers inclusion can be found in \ref demos. * * \section compiling Compiling - * The library uses c++11 and requires Boost with version 1.56.0 or + * The library uses c++11 and requires Boost with version 1.48.0 or * more recent. It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2015. * * \subsection demos Demos and examples diff --git a/src/cython/doc/installation.rst b/src/cython/doc/installation.rst index 2f689497..c182f176 100644 --- a/src/cython/doc/installation.rst +++ b/src/cython/doc/installation.rst @@ -5,7 +5,7 @@ Compiling ********* The library uses c++11 and requires `Boost `_ with -version 1.56.0 or more recent. It is a multi-platform library and compiles on +version 1.48.0 or more recent. It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2015. It also requires cmake to generate makefiles, and cython to compile the library. -- cgit v1.2.3 From 00e6e420e6bda8bc703de4d2de6e831821bad906 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 22 Jan 2018 12:50:03 +0000 Subject: Fix some cpplint git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3148 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 34a01d0b7d9b59e72fd14e7616a09dde50e1dbd1 --- .../utilities/alpha_complex_3d_helper.h | 2 +- .../utilities/alpha_complex_3d_persistence.cpp | 13 ++++++------- .../exact_alpha_complex_3d_persistence.cpp | 10 +++++----- .../periodic_alpha_complex_3d_persistence.cpp | 13 ++++++------- .../weighted_alpha_complex_3d_persistence.cpp | 18 +++++++++--------- ...ghted_periodic_alpha_complex_3d_persistence.cpp | 22 ++++++++++------------ src/Nerve_GIC/include/gudhi/GIC.h | 11 ++++++----- 7 files changed, 43 insertions(+), 46 deletions(-) (limited to 'src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp') diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_helper.h b/src/Alpha_complex/utilities/alpha_complex_3d_helper.h index 3747923f..a59f0654 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_helper.h +++ b/src/Alpha_complex/utilities/alpha_complex_3d_helper.h @@ -52,7 +52,7 @@ Vertex_list from_facet(const Facet& fct) { template Vertex_list from_edge(const Edge_3& edg) { Vertex_list the_list; - for (auto i : { edg.second, edg.third }) { + for (auto i : {edg.second, edg.third}) { #ifdef DEBUG_TRACES std::cout << "from edge[" << i << "]=" << edg.first->vertex(i)->point() << std::endl; #endif // DEBUG_TRACES diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index 1070d17b..8ef5ffb2 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -138,16 +138,16 @@ int main(int argc, char **argv) { std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object - if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { + if (const Cell_handle *cell = CGAL::object_cast(&object_iterator)) { vertex_list = from_cell(*cell); count_cells++; - } else if (const Facet* facet = CGAL::object_cast(&object_iterator)) { + } else if (const Facet *facet = CGAL::object_cast(&object_iterator)) { vertex_list = from_facet(*facet); count_facets++; - } else if (const Edge_3* edge = CGAL::object_cast(&object_iterator)) { + } else if (const Edge_3 *edge = CGAL::object_cast(&object_iterator)) { vertex_list = from_edge(*edge); count_edges++; - } else if (const Vertex_handle* vertex = CGAL::object_cast(&object_iterator)) { + } else if (const Vertex_handle *vertex = CGAL::object_cast(&object_iterator)) { count_vertices++; vertex_list = from_vertex(*vertex); } @@ -173,13 +173,12 @@ int main(int argc, char **argv) { } } // Construction of the simplex_tree - Filtration_value filtr = /*std::sqrt*/(*the_alpha_value_iterator); + Filtration_value filtr = /*std::sqrt*/ (*the_alpha_value_iterator); #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES simplex_tree.insert_simplex(the_simplex, filtr); - GUDHI_CHECK(the_alpha_value_iterator != the_alpha_values.end(), - "CGAL provided more simplices than values"); + GUDHI_CHECK(the_alpha_value_iterator != the_alpha_values.end(), "CGAL provided more simplices than values"); ++the_alpha_value_iterator; } diff --git a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp index 3b9a2ae0..cceac46e 100644 --- a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp @@ -129,16 +129,16 @@ int main(int argc, char **argv) { std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object - if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { + if (const Cell_handle *cell = CGAL::object_cast(&object_iterator)) { vertex_list = from_cell(*cell); count_cells++; - } else if (const Facet* facet = CGAL::object_cast(&object_iterator)) { + } else if (const Facet *facet = CGAL::object_cast(&object_iterator)) { vertex_list = from_facet(*facet); count_facets++; - } else if (const Edge_3* edge = CGAL::object_cast(&object_iterator)) { + } else if (const Edge_3 *edge = CGAL::object_cast(&object_iterator)) { vertex_list = from_edge(*edge); count_edges++; - } else if (const Vertex_handle* vertex = CGAL::object_cast(&object_iterator)) { + } else if (const Vertex_handle *vertex = CGAL::object_cast(&object_iterator)) { count_vertices++; vertex_list = from_vertex(*vertex); } @@ -165,7 +165,7 @@ int main(int argc, char **argv) { } // Construction of the simplex_tree // you can also use the_alpha_value_iterator->exact() - Filtration_value filtr = /*std::sqrt*/CGAL::to_double(the_alpha_value_iterator->exact()); + Filtration_value filtr = /*std::sqrt*/ CGAL::to_double(the_alpha_value_iterator->exact()); #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; #endif // DEBUG_TRACES diff --git a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp index ac72dcc4..188cf604 100644 --- a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp @@ -113,9 +113,8 @@ int main(int argc, char **argv) { std::cerr << "Unable to read file " << cuboid_file << std::endl; exit(-1); } - //Checking if the cuboid is the same in x,y and z direction. If not, CGAL will not process it. - if ((x_max-x_min != y_max-y_min) || (x_max-x_min != z_max-z_min) || (z_max-z_min != y_max-y_min)) - { + // Checking if the cuboid is the same in x,y and z direction. If not, CGAL will not process it. + if ((x_max - x_min != y_max - y_min) || (x_max - x_min != z_max - z_min) || (z_max - z_min != y_max - y_min)) { std::cerr << "The size of the cuboid in every directions is not the same." << std::endl; exit(-1); } @@ -164,16 +163,16 @@ int main(int argc, char **argv) { std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object - if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { + if (const Cell_handle *cell = CGAL::object_cast(&object_iterator)) { vertex_list = from_cell(*cell); count_cells++; - } else if (const Facet* facet = CGAL::object_cast(&object_iterator)) { + } else if (const Facet *facet = CGAL::object_cast(&object_iterator)) { vertex_list = from_facet(*facet); count_facets++; - } else if (const Edge_3* edge = CGAL::object_cast(&object_iterator)) { + } else if (const Edge_3 *edge = CGAL::object_cast(&object_iterator)) { vertex_list = from_edge(*edge); count_edges++; - } else if (const Vertex_handle* vertex = CGAL::object_cast(&object_iterator)) { + } else if (const Vertex_handle *vertex = CGAL::object_cast(&object_iterator)) { count_vertices++; vertex_list = from_vertex(*vertex); } diff --git a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp index f46f1a58..93be8a05 100644 --- a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp @@ -65,13 +65,13 @@ using Point_3 = Gt::Bare_point; using Weighted_point_3 = Gt::Weighted_point; // For CGAL >= 4.11 -#else // CGAL_VERSION_NR < 1041100000 +#else // CGAL_VERSION_NR < 1041100000 using Rvb = CGAL::Regular_triangulation_vertex_base_3; -using Vb = CGAL::Alpha_shape_vertex_base_3; +using Vb = CGAL::Alpha_shape_vertex_base_3; using Rcb = CGAL::Regular_triangulation_cell_base_3; -using Cb = CGAL::Alpha_shape_cell_base_3; -using Tds = CGAL::Triangulation_data_structure_3; -using Triangulation_3 = CGAL::Regular_triangulation_3; +using Cb = CGAL::Alpha_shape_cell_base_3; +using Tds = CGAL::Triangulation_data_structure_3; +using Triangulation_3 = CGAL::Regular_triangulation_3; // From file type definition using Point_3 = Triangulation_3::Bare_point; @@ -177,16 +177,16 @@ int main(int argc, char **argv) { std::vector::iterator the_alpha_value_iterator = the_alpha_values.begin(); for (auto object_iterator : the_objects) { // Retrieve Alpha shape vertex list from object - if (const Cell_handle* cell = CGAL::object_cast(&object_iterator)) { + if (const Cell_handle *cell = CGAL::object_cast(&object_iterator)) { vertex_list = from_cell(*cell); count_cells++; - } else if (const Facet* facet = CGAL::object_cast(&object_iterator)) { + } else if (const Facet *facet = CGAL::object_cast(&object_iterator)) { vertex_list = from_facet(*facet); count_facets++; - } else if (const Edge_3* edge = CGAL::object_cast(&object_iterator)) { + } else if (const Edge_3 *edge = CGAL::object_cast(&object_iterator)) { vertex_list = from_edge(*edge); count_edges++; - } else if (const Vertex_handle* vertex = CGAL::object_cast(&object_iterator)) { + } else if (const Vertex_handle *vertex = CGAL::object_cast(&object_iterator)) { count_vertices++; vertex_list = from_vertex(*vertex); } diff --git a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp index 0fe8931f..5321bb0a 100644 --- a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp @@ -50,14 +50,14 @@ using PK = CGAL::Periodic_3_regular_triangulation_traits_3; // Vertex type using DsVb = CGAL::Periodic_3_triangulation_ds_vertex_base_3<>; -using Vb = CGAL::Regular_triangulation_vertex_base_3; -using AsVb = CGAL::Alpha_shape_vertex_base_3; +using Vb = CGAL::Regular_triangulation_vertex_base_3; +using AsVb = CGAL::Alpha_shape_vertex_base_3; // Cell type using DsCb = CGAL::Periodic_3_triangulation_ds_cell_base_3<>; -using Cb = CGAL::Regular_triangulation_cell_base_3; -using AsCb = CGAL::Alpha_shape_cell_base_3; -using Tds = CGAL::Triangulation_data_structure_3; -using P3RT3 = CGAL::Periodic_3_regular_triangulation_3; +using Cb = CGAL::Regular_triangulation_cell_base_3; +using AsCb = CGAL::Alpha_shape_cell_base_3; +using Tds = CGAL::Triangulation_data_structure_3; +using P3RT3 = CGAL::Periodic_3_regular_triangulation_3; using Alpha_shape_3 = CGAL::Alpha_shape_3; using Point_3 = P3RT3::Bare_point; @@ -127,14 +127,13 @@ int main(int argc, char* const argv[]) { std::cerr << "Unable to read file " << argv[3] << std::endl; usage(argv[0]); } - //Checking if the cuboid is the same in x,y and z direction. If not, CGAL will not process it. - if ((x_max-x_min != y_max-y_min) || (x_max-x_min != z_max-z_min) || (z_max-z_min != y_max-y_min)) - { + // Checking if the cuboid is the same in x,y and z direction. If not, CGAL will not process it. + if ((x_max - x_min != y_max - y_min) || (x_max - x_min != z_max - z_min) || (z_max - z_min != y_max - y_min)) { std::cerr << "The size of the cuboid in every directions is not the same." << std::endl; exit(-1); } - double maximal_possible_weight = 0.015625 * (x_max-x_min) * (x_max-x_min); + double maximal_possible_weight = 0.015625 * (x_max - x_min) * (x_max - x_min); // Read weights information from file std::ifstream weights_ifstr(argv[2]); @@ -145,8 +144,7 @@ int main(int argc, char* const argv[]) { wp.reserve(lp.size()); // Attempt read the weight in a double format, return false if it fails while ((weights_ifstr >> weight) && (index < lp.size())) { - if ((weight >= maximal_possible_weight) || (weight < 0)) - { + if ((weight >= maximal_possible_weight) || (weight < 0)) { std::cerr << "At line " << (index + 1) << ", the weight (" << weight << ") is negative or more than or equal to maximal possible weight (" << maximal_possible_weight << ") = 1/64*cuboid length squared, which is not an acceptable input." << std::endl; diff --git a/src/Nerve_GIC/include/gudhi/GIC.h b/src/Nerve_GIC/include/gudhi/GIC.h index 9dc754f4..2fd61f14 100644 --- a/src/Nerve_GIC/include/gudhi/GIC.h +++ b/src/Nerve_GIC/include/gudhi/GIC.h @@ -169,9 +169,9 @@ class Cover_complex { double u; while (m < sampleSize) { u = GetUniform(); - if ((populationSize - t) * u >= sampleSize - m) + if ((populationSize - t) * u >= sampleSize - m) { t++; - else { + } else { samples[m] = t; t++; m++; @@ -679,8 +679,9 @@ class Cover_complex { tmp++; } u = inter3.second; - } else + } else { u = inter1.first; + } std::pair inter2 = intervals[i + 1]; while (func[points[tmp]] < inter2.first && tmp != n) { @@ -1110,9 +1111,9 @@ class Cover_complex { */ template void compute_distribution(int N = 100) { - if (distribution.size() >= N) + if (distribution.size() >= N) { std::cout << "Already done!" << std::endl; - else { + } else { for (int i = 0; i < N - distribution.size(); i++) { Cover_complex Cboot; Cboot.n = this->n; -- cgit v1.2.3