diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-01-22 12:50:03 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-01-22 12:50:03 +0000 |
commit | 00e6e420e6bda8bc703de4d2de6e831821bad906 (patch) | |
tree | 8759df0fb8808ec3f435bfcfcbf0e444e1ac68c0 | |
parent | 1c50d7332a0dcfb15d4349b44a34804d321f1710 (diff) |
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
7 files changed, 43 insertions, 46 deletions
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 <class Vertex_list, class Edge_3> 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<Alpha_value_type>::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<Cell_handle>(&object_iterator)) { + if (const Cell_handle *cell = CGAL::object_cast<Cell_handle>(&object_iterator)) { vertex_list = from_cell<Vertex_list, Cell_handle>(*cell); count_cells++; - } else if (const Facet* facet = CGAL::object_cast<Facet>(&object_iterator)) { + } else if (const Facet *facet = CGAL::object_cast<Facet>(&object_iterator)) { vertex_list = from_facet<Vertex_list, Facet>(*facet); count_facets++; - } else if (const Edge_3* edge = CGAL::object_cast<Edge_3>(&object_iterator)) { + } else if (const Edge_3 *edge = CGAL::object_cast<Edge_3>(&object_iterator)) { vertex_list = from_edge<Vertex_list, Edge_3>(*edge); count_edges++; - } else if (const Vertex_handle* vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) { + } else if (const Vertex_handle *vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) { count_vertices++; vertex_list = from_vertex<Vertex_list, Vertex_handle>(*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<Alpha_value_type>::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<Cell_handle>(&object_iterator)) { + if (const Cell_handle *cell = CGAL::object_cast<Cell_handle>(&object_iterator)) { vertex_list = from_cell<Vertex_list, Cell_handle>(*cell); count_cells++; - } else if (const Facet* facet = CGAL::object_cast<Facet>(&object_iterator)) { + } else if (const Facet *facet = CGAL::object_cast<Facet>(&object_iterator)) { vertex_list = from_facet<Vertex_list, Facet>(*facet); count_facets++; - } else if (const Edge_3* edge = CGAL::object_cast<Edge_3>(&object_iterator)) { + } else if (const Edge_3 *edge = CGAL::object_cast<Edge_3>(&object_iterator)) { vertex_list = from_edge<Vertex_list, Edge_3>(*edge); count_edges++; - } else if (const Vertex_handle* vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) { + } else if (const Vertex_handle *vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) { count_vertices++; vertex_list = from_vertex<Vertex_list, Vertex_handle>(*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<Alpha_value_type>::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<Cell_handle>(&object_iterator)) { + if (const Cell_handle *cell = CGAL::object_cast<Cell_handle>(&object_iterator)) { vertex_list = from_cell<Vertex_list, Cell_handle>(*cell); count_cells++; - } else if (const Facet* facet = CGAL::object_cast<Facet>(&object_iterator)) { + } else if (const Facet *facet = CGAL::object_cast<Facet>(&object_iterator)) { vertex_list = from_facet<Vertex_list, Facet>(*facet); count_facets++; - } else if (const Edge_3* edge = CGAL::object_cast<Edge_3>(&object_iterator)) { + } else if (const Edge_3 *edge = CGAL::object_cast<Edge_3>(&object_iterator)) { vertex_list = from_edge<Vertex_list, Edge_3>(*edge); count_edges++; - } else if (const Vertex_handle* vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) { + } else if (const Vertex_handle *vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) { count_vertices++; vertex_list = from_vertex<Vertex_list, Vertex_handle>(*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<Kernel>; -using Vb = CGAL::Alpha_shape_vertex_base_3<Kernel,Rvb>; +using Vb = CGAL::Alpha_shape_vertex_base_3<Kernel, Rvb>; using Rcb = CGAL::Regular_triangulation_cell_base_3<Kernel>; -using Cb = CGAL::Alpha_shape_cell_base_3<Kernel,Rcb>; -using Tds = CGAL::Triangulation_data_structure_3<Vb,Cb>; -using Triangulation_3 = CGAL::Regular_triangulation_3<Kernel,Tds>; +using Cb = CGAL::Alpha_shape_cell_base_3<Kernel, Rcb>; +using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb>; +using Triangulation_3 = CGAL::Regular_triangulation_3<Kernel, Tds>; // From file type definition using Point_3 = Triangulation_3::Bare_point; @@ -177,16 +177,16 @@ int main(int argc, char **argv) { std::vector<Alpha_value_type>::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<Cell_handle>(&object_iterator)) { + if (const Cell_handle *cell = CGAL::object_cast<Cell_handle>(&object_iterator)) { vertex_list = from_cell<Vertex_list, Cell_handle>(*cell); count_cells++; - } else if (const Facet* facet = CGAL::object_cast<Facet>(&object_iterator)) { + } else if (const Facet *facet = CGAL::object_cast<Facet>(&object_iterator)) { vertex_list = from_facet<Vertex_list, Facet>(*facet); count_facets++; - } else if (const Edge_3* edge = CGAL::object_cast<Edge_3>(&object_iterator)) { + } else if (const Edge_3 *edge = CGAL::object_cast<Edge_3>(&object_iterator)) { vertex_list = from_edge<Vertex_list, Edge_3>(*edge); count_edges++; - } else if (const Vertex_handle* vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) { + } else if (const Vertex_handle *vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) { count_vertices++; vertex_list = from_vertex<Vertex_list, Vertex_handle>(*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<Kernel>; // Vertex type using DsVb = CGAL::Periodic_3_triangulation_ds_vertex_base_3<>; -using Vb = CGAL::Regular_triangulation_vertex_base_3<PK,DsVb>; -using AsVb = CGAL::Alpha_shape_vertex_base_3<PK,Vb>; +using Vb = CGAL::Regular_triangulation_vertex_base_3<PK, DsVb>; +using AsVb = CGAL::Alpha_shape_vertex_base_3<PK, Vb>; // Cell type using DsCb = CGAL::Periodic_3_triangulation_ds_cell_base_3<>; -using Cb = CGAL::Regular_triangulation_cell_base_3<PK,DsCb>; -using AsCb = CGAL::Alpha_shape_cell_base_3<PK,Cb>; -using Tds = CGAL::Triangulation_data_structure_3<AsVb,AsCb>; -using P3RT3 = CGAL::Periodic_3_regular_triangulation_3<PK,Tds>; +using Cb = CGAL::Regular_triangulation_cell_base_3<PK, DsCb>; +using AsCb = CGAL::Alpha_shape_cell_base_3<PK, Cb>; +using Tds = CGAL::Triangulation_data_structure_3<AsVb, AsCb>; +using P3RT3 = CGAL::Periodic_3_regular_triangulation_3<PK, Tds>; using Alpha_shape_3 = CGAL::Alpha_shape_3<P3RT3>; 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<double, double> inter2 = intervals[i + 1]; while (func[points[tmp]] < inter2.first && tmp != n) { @@ -1110,9 +1111,9 @@ class Cover_complex { */ template <typename SimplicialComplex> 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; |