summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-24 10:16:44 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-24 10:16:44 +0000
commitc17e58a6434e17e361b39b91ca344b8eedb197ef (patch)
tree2f50bdceb9387e42629f10ce1bd8500b98edcf0d
parent0e33927bb4feff77965b86a8da0ea0f7346e2ccd (diff)
cpplint fixes
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2232 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: ac02d5dd3b2aedd4795f775c228fe5ef7e1b3320
-rw-r--r--src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp2
-rw-r--r--src/Contraction/example/Garland_heckbert/Error_quadric.h6
-rw-r--r--src/Persistent_cohomology/example/alpha_complex_3d_helper.h6
-rw-r--r--src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp4
-rw-r--r--src/Persistent_cohomology/example/exact_alpha_complex_3d_persistence.cpp4
-rw-r--r--src/Persistent_cohomology/example/periodic_alpha_complex_3d_persistence.cpp4
-rw-r--r--src/Persistent_cohomology/example/plain_homology.cpp11
-rw-r--r--src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp9
-rw-r--r--src/Simplex_tree/example/mini_simplex_tree.cpp9
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h2
-rw-r--r--src/common/include/gudhi/distance_functions.h4
-rw-r--r--src/cython/include/Persistent_cohomology_interface.h1
12 files changed, 30 insertions, 32 deletions
diff --git a/src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp b/src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp
index 6e9be97b..fd9f0858 100644
--- a/src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp
+++ b/src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp
@@ -56,7 +56,7 @@ void program_options(int argc, char * argv[]
, int & p
, Filtration_value & min_persistence);
-static inline std::pair<double, double> compute_root_square (std::pair<double, double> input) {
+static inline std::pair<double, double> compute_root_square(std::pair<double, double> input) {
return std::make_pair(std::sqrt(input.first), std::sqrt(input.second));
}
diff --git a/src/Contraction/example/Garland_heckbert/Error_quadric.h b/src/Contraction/example/Garland_heckbert/Error_quadric.h
index 076f1be0..e7dafaa0 100644
--- a/src/Contraction/example/Garland_heckbert/Error_quadric.h
+++ b/src/Contraction/example/Garland_heckbert/Error_quadric.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef ERROR_QUADRIC_H_
-#define ERROR_QUADRIC_H_
+#ifndef GARLAND_HECKBERT_ERROR_QUADRIC_H_
+#define GARLAND_HECKBERT_ERROR_QUADRIC_H_
#include <boost/optional/optional.hpp>
@@ -179,4 +179,4 @@ template <typename Point> class Error_quadric {
}
};
-#endif // ERROR_QUADRIC_H_
+#endif // GARLAND_HECKBERT_ERROR_QUADRIC_H_
diff --git a/src/Persistent_cohomology/example/alpha_complex_3d_helper.h b/src/Persistent_cohomology/example/alpha_complex_3d_helper.h
index ceefd2ba..7865e4ec 100644
--- a/src/Persistent_cohomology/example/alpha_complex_3d_helper.h
+++ b/src/Persistent_cohomology/example/alpha_complex_3d_helper.h
@@ -20,8 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef EXAMPLE_PERSISTENT_COHOMOLOGY_ALPHA_COMPLEX_3D_HELPER_H_
-#define EXAMPLE_PERSISTENT_COHOMOLOGY_ALPHA_COMPLEX_3D_HELPER_H_
+#ifndef ALPHA_COMPLEX_3D_HELPER_H_
+#define ALPHA_COMPLEX_3D_HELPER_H_
template<class Vertex_list, class Cell_handle>
Vertex_list from_cell(const Cell_handle& ch) {
@@ -73,4 +73,4 @@ Vertex_list from_vertex(const Vertex_handle& vh) {
return the_list;
}
-#endif // EXAMPLE_PERSISTENT_COHOMOLOGY_ALPHA_COMPLEX_3D_HELPER_H_
+#endif // ALPHA_COMPLEX_3D_HELPER_H_
diff --git a/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp b/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp
index ffb98283..40f4aff9 100644
--- a/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp
+++ b/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp
@@ -20,6 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "alpha_complex_3d_helper.h"
+
#include <gudhi/Simplex_tree.h>
#include <gudhi/Persistent_cohomology.h>
#include <gudhi/Points_3D_off_io.h>
@@ -30,8 +32,6 @@
#include <CGAL/Alpha_shape_3.h>
#include <CGAL/iterator.h>
-#include "alpha_complex_3d_helper.h"
-
#include <fstream>
#include <cmath>
#include <string>
diff --git a/src/Persistent_cohomology/example/exact_alpha_complex_3d_persistence.cpp b/src/Persistent_cohomology/example/exact_alpha_complex_3d_persistence.cpp
index c016a596..70054601 100644
--- a/src/Persistent_cohomology/example/exact_alpha_complex_3d_persistence.cpp
+++ b/src/Persistent_cohomology/example/exact_alpha_complex_3d_persistence.cpp
@@ -20,6 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "alpha_complex_3d_helper.h"
+
#include <gudhi/Simplex_tree.h>
#include <gudhi/Persistent_cohomology.h>
#include <gudhi/Points_3D_off_io.h>
@@ -30,8 +32,6 @@
#include <CGAL/Alpha_shape_3.h>
#include <CGAL/iterator.h>
-#include "alpha_complex_3d_helper.h"
-
#include <fstream>
#include <cmath>
#include <string>
diff --git a/src/Persistent_cohomology/example/periodic_alpha_complex_3d_persistence.cpp b/src/Persistent_cohomology/example/periodic_alpha_complex_3d_persistence.cpp
index 4f6ea40e..28f563aa 100644
--- a/src/Persistent_cohomology/example/periodic_alpha_complex_3d_persistence.cpp
+++ b/src/Persistent_cohomology/example/periodic_alpha_complex_3d_persistence.cpp
@@ -20,6 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "alpha_complex_3d_helper.h"
+
#include <gudhi/Simplex_tree.h>
#include <gudhi/Persistent_cohomology.h>
#include <gudhi/Points_3D_off_io.h>
@@ -31,8 +33,6 @@
#include <CGAL/Alpha_shape_3.h>
#include <CGAL/iterator.h>
-#include "alpha_complex_3d_helper.h"
-
#include <fstream>
#include <cmath>
#include <string>
diff --git a/src/Persistent_cohomology/example/plain_homology.cpp b/src/Persistent_cohomology/example/plain_homology.cpp
index ae82c817..50f692f2 100644
--- a/src/Persistent_cohomology/example/plain_homology.cpp
+++ b/src/Persistent_cohomology/example/plain_homology.cpp
@@ -27,13 +27,11 @@
#include <vector>
#include <cstdint> // for std::uint8_t
-using namespace Gudhi;
-
/* We could perfectly well use the default Simplex_tree<> (which uses
* Simplex_tree_options_full_featured), the following simply demonstrates
* how to save on storage by not storing a filtration value. */
-struct MyOptions : Simplex_tree_options_full_featured {
+struct MyOptions : Gudhi::Simplex_tree_options_full_featured {
// Implicitly use 0 as filtration value for all simplices
static const bool store_filtration = false;
// The persistence algorithm needs this
@@ -43,7 +41,10 @@ struct MyOptions : Simplex_tree_options_full_featured {
// Maximum number of simplices to compute persistence is 2^8 - 1 = 255. One is reserved for null_key
typedef std::uint8_t Simplex_key;
};
-typedef Simplex_tree<MyOptions> ST;
+
+using ST = Gudhi::Simplex_tree<MyOptions>;
+using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
+using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<ST, Field_Zp>;
int main() {
ST st;
@@ -70,7 +71,7 @@ int main() {
st.initialize_filtration();
// Class for homology computation
- persistent_cohomology::Persistent_cohomology<ST, persistent_cohomology::Field_Zp> pcoh(st);
+ Persistent_cohomology pcoh(st);
// Initialize the coefficient field Z/2Z for homology
pcoh.init_coefficients(2);
diff --git a/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp b/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp
index 5203548a..0b137535 100644
--- a/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp
+++ b/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp
@@ -20,6 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "alpha_complex_3d_helper.h"
+
#include <gudhi/Simplex_tree.h>
#include <gudhi/Persistent_cohomology.h>
#include <gudhi/Points_3D_off_io.h>
@@ -31,8 +33,6 @@
#include <CGAL/Alpha_shape_3.h>
#include <CGAL/iterator.h>
-#include "alpha_complex_3d_helper.h"
-
#include <fstream>
#include <cmath>
#include <string>
@@ -49,7 +49,7 @@ using Gt = CGAL::Regular_triangulation_euclidean_traits_3<Kernel>;
using Vb = CGAL::Alpha_shape_vertex_base_3<Gt>;
using Fb = CGAL::Alpha_shape_cell_base_3<Gt>;
using Tds = CGAL::Triangulation_data_structure_3<Vb, Fb>;
-using Triangulation_3 = CGAL::Regular_triangulation_3<Gt,Tds>;
+using Triangulation_3 = CGAL::Regular_triangulation_3<Gt, Tds>;
using Alpha_shape_3 = CGAL::Alpha_shape_3<Triangulation_3>;
// From file type definition
@@ -115,8 +115,7 @@ int main(int argc, char * const argv[]) {
double weight = 0.0;
std::size_t index = 0;
// Attempt read the weight in a double format, return false if it fails
- while((weights_ifstr >> weight) && (index < lp.size()))
- {
+ while ((weights_ifstr >> weight) && (index < lp.size())) {
wp.push_back(Weighted_point_3(lp[index], weight));
index++;
}
diff --git a/src/Simplex_tree/example/mini_simplex_tree.cpp b/src/Simplex_tree/example/mini_simplex_tree.cpp
index 7e48aaaf..ad99df23 100644
--- a/src/Simplex_tree/example/mini_simplex_tree.cpp
+++ b/src/Simplex_tree/example/mini_simplex_tree.cpp
@@ -24,19 +24,18 @@
#include <iostream>
#include <initializer_list>
-using namespace Gudhi;
-
-struct MyOptions : Simplex_tree_options_full_featured {
+struct MyOptions : Gudhi::Simplex_tree_options_full_featured {
// Not doing persistence, so we don't need those
static const bool store_key = false;
static const bool store_filtration = false;
// I have few vertices
typedef short Vertex_handle;
};
-typedef Simplex_tree<MyOptions> ST;
+
+using ST = Gudhi::Simplex_tree<MyOptions>;
// Dictionary should be private, but for now this is the easiest way.
-static_assert(sizeof(ST::Dictionary::value_type) < sizeof(Simplex_tree<>::Dictionary::value_type),
+static_assert(sizeof(ST::Dictionary::value_type) < sizeof(Gudhi::Simplex_tree<>::Dictionary::value_type),
"Not storing the filtration and key should save some space");
int main() {
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h
index e2791f76..63f03687 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex.h
@@ -178,7 +178,7 @@ class Witness_complex {
norelax_dist2 = l_it->second;
}
} else if (dim == 0) {
- for (;l_it != end && l_it->second - alpha2 <= norelax_dist2; ++l_it) {
+ for (; l_it != end && l_it->second - alpha2 <= norelax_dist2; ++l_it) {
simplex.push_back(l_it->first);
double filtration_value = 0;
// if norelax_dist is infinite, relaxation is 0.
diff --git a/src/common/include/gudhi/distance_functions.h b/src/common/include/gudhi/distance_functions.h
index 7bf97c23..22747637 100644
--- a/src/common/include/gudhi/distance_functions.h
+++ b/src/common/include/gudhi/distance_functions.h
@@ -24,8 +24,8 @@
#define DISTANCE_FUNCTIONS_H_
#include <cmath> // for std::sqrt
-#include <type_traits> // for std::decay
-#include <iterator> // for std::begin, std::end
+#include <type_traits> // for std::decay
+#include <iterator> // for std::begin, std::end
/** @file
* @brief Global distance functions
diff --git a/src/cython/include/Persistent_cohomology_interface.h b/src/cython/include/Persistent_cohomology_interface.h
index 25c458d2..55028fd0 100644
--- a/src/cython/include/Persistent_cohomology_interface.h
+++ b/src/cython/include/Persistent_cohomology_interface.h
@@ -88,7 +88,6 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol
private:
// A copy
FilteredComplex* stptr_;
-
};
} // namespace Gudhi