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 ++++++++++------------ 6 files changed, 37 insertions(+), 41 deletions(-) (limited to 'src/Alpha_complex/utilities') 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; -- cgit v1.2.3