summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-05-30 11:12:25 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-05-30 11:12:25 +0000
commit270c69e3e96931b6f355af421fee414340c642c2 (patch)
tree59dda979075c1cbbc80d44343f79ab2025d90814
parent89d9823699f91298aa90f45a9ced8595cf7a596a (diff)
cpplint fixes
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/get_persistence@1219 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 81a6208f769c5237d4f81bc97fc1f3d581e733be
-rw-r--r--src/Persistent_cohomology/example/custom_persistence_sort.cpp1
-rw-r--r--src/Persistent_cohomology/example/plain_homology.cpp9
-rw-r--r--src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h14
3 files changed, 12 insertions, 12 deletions
diff --git a/src/Persistent_cohomology/example/custom_persistence_sort.cpp b/src/Persistent_cohomology/example/custom_persistence_sort.cpp
index 4dab4560..d591a0d0 100644
--- a/src/Persistent_cohomology/example/custom_persistence_sort.cpp
+++ b/src/Persistent_cohomology/example/custom_persistence_sort.cpp
@@ -32,6 +32,7 @@
#include <iterator>
#include <vector>
#include <fstream> // for std::ofstream
+#include <algorithm> // for std::sort
using Kernel = CGAL::Epick_d< CGAL::Dimension_tag<3> >;
diff --git a/src/Persistent_cohomology/example/plain_homology.cpp b/src/Persistent_cohomology/example/plain_homology.cpp
index 5afce9e2..2156ffd9 100644
--- a/src/Persistent_cohomology/example/plain_homology.cpp
+++ b/src/Persistent_cohomology/example/plain_homology.cpp
@@ -77,13 +77,12 @@ int main() {
// Print the result. The format is, on each line: 2 dim 0 inf
// where 2 represents the field, dim the dimension of the feature.
- // 2 0 0 inf
- // 2 0 0 inf
- // 2 1 0 inf
+ // 2 0 0 inf
+ // 2 0 0 inf
+ // 2 1 0 inf
// means that in Z/2Z-homology, the Betti numbers are b0=2 and b1=1.
pcoh.output_diagram();
-
-
+
// Print the Betti numbers are b0=2 and b1=1.
std::cout << std::endl;
std::cout << "The Betti numbers are : ";
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
index 5b4c215a..23beaa96 100644
--- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
+++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
@@ -599,7 +599,7 @@ class Persistent_cohomology {
std::vector<int> betti_numbers() const {
// Init Betti numbers vector with zeros until Simplicial complex dimension
std::vector<int> betti_numbers(cpx_->dimension(), 0);
-
+
for (auto pair : persistent_pairs_) {
// Count never ended persistence intervals
if (cpx_->null_simplex() == get<1>(pair)) {
@@ -617,7 +617,7 @@ class Persistent_cohomology {
*/
int betti_number(int dimension) const {
int betti_number = 0;
-
+
for (auto pair : persistent_pairs_) {
// Count never ended persistence intervals
if (cpx_->null_simplex() == get<1>(pair)) {
@@ -629,7 +629,7 @@ class Persistent_cohomology {
}
return betti_number;
}
-
+
/** @brief Returns the persistent Betti numbers.
* @param[in] from The persistence birth limit to be added in the number \f$(persistent birth \leq from)\f$.
* @param[in] to The persistence death limit to be added in the number \f$(persistent death > from)\f$.
@@ -638,7 +638,7 @@ class Persistent_cohomology {
std::vector<int> persistent_betti_numbers(Filtration_value from, Filtration_value to) const {
// Init Betti numbers vector with zeros until Simplicial complex dimension
std::vector<int> betti_numbers(cpx_->dimension(), 0);
-
+
for (auto pair : persistent_pairs_) {
// Count persistence intervals that covers the given interval
if (cpx_->filtration(get<0>(pair)) <= from && cpx_->filtration(get<1>(pair)) > to) {
@@ -656,7 +656,7 @@ class Persistent_cohomology {
*/
int persistent_betti_number(int dimension, Filtration_value from, Filtration_value to) const {
int betti_number = 0;
-
+
for (auto pair : persistent_pairs_) {
// Count persistence intervals that covers the given interval
if (cpx_->filtration(get<0>(pair)) <= from && cpx_->filtration(get<1>(pair)) > to) {
@@ -668,7 +668,7 @@ class Persistent_cohomology {
}
return betti_number;
}
-
+
/** @brief Returns the persistent pairs.
* @return Persistent pairs
*
@@ -676,7 +676,7 @@ class Persistent_cohomology {
const std::vector<Persistent_interval>& get_persistent_pairs() const {
return persistent_pairs_;
}
-
+
private:
/*
* Structure representing a cocycle.