summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-27 08:53:57 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-27 08:53:57 +0000
commit7a701f8a2326268b2aadb369fbc0848b227078a1 (patch)
treef5d17d492a5e5e1a61c6eae785beee08506e0637 /src
parent2f0d4a7a06f8fde904b75b27c3836e362f549707 (diff)
Fix naming conventions and cpplint
Add Bottleneck_distance to GUDHI_MODULES in GUDHI_user_version_target.txt git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneck_integration@1569 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b96a2be25477ddf227e43d9941989f93a0f626bb
Diffstat (limited to 'src')
-rw-r--r--src/Bottleneck_distance/concept/Persistence_diagram.h37
-rw-r--r--src/Bottleneck_distance/doc/Intro_bottleneck_distance.h9
-rw-r--r--src/Bottleneck_distance/example/bottleneck_example.cpp13
-rw-r--r--src/Bottleneck_distance/include/gudhi/CGAL/Miscellaneous.h2
-rw-r--r--src/Bottleneck_distance/include/gudhi/Graph_matching.h10
-rw-r--r--src/Bottleneck_distance/include/gudhi/Internal_point.h10
-rw-r--r--src/Bottleneck_distance/include/gudhi/Neighbors_finder.h10
-rw-r--r--src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h10
-rw-r--r--src/Bottleneck_distance/include/gudhi/Planar_neighbors_finder.h10
-rw-r--r--src/Bottleneck_distance/test/bottleneck_chrono.cpp2
-rw-r--r--src/Bottleneck_distance/test/bottleneck_unit_test.cpp2
-rw-r--r--src/cmake/modules/GUDHI_user_version_target.txt2
12 files changed, 74 insertions, 43 deletions
diff --git a/src/Bottleneck_distance/concept/Persistence_diagram.h b/src/Bottleneck_distance/concept/Persistence_diagram.h
index bd90cc11..4c69343c 100644
--- a/src/Bottleneck_distance/concept/Persistence_diagram.h
+++ b/src/Bottleneck_distance/concept/Persistence_diagram.h
@@ -1,6 +1,31 @@
+/* This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * library for computational topology.
+ *
+ * Author(s): François Godi
+ *
+ * Copyright (C) 2016 INRIA
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CONCEPT_BOTTLENECK_DISTANCE_PERSISTENCE_DIAGRAM_H_
+#define CONCEPT_BOTTLENECK_DISTANCE_PERSISTENCE_DIAGRAM_H_
+
namespace Gudhi {
-namespace Bottleneck_distance {
-namespace Concept {
+
+namespace bottleneck_distance {
/** \brief Concept of persistence diagram point. The double first is the birth of the component and the double second is the death of the component.
*
@@ -21,6 +46,8 @@ struct Persistence_Diagram
const_iterator<Diagram_point> cend() const;
};
-} //namespace Concept
-} //namespace Bottleneck_distance
-} //namespace Gudhi
+} // namespace bottleneck_distance
+
+} // namespace Gudhi
+
+#endif // CONCEPT_BOTTLENECK_DISTANCE_PERSISTENCE_DIAGRAM_H_
diff --git a/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h b/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h
index 2cf10975..9a792048 100644
--- a/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h
+++ b/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h
@@ -26,15 +26,20 @@
// needs namespace for Doxygen to link on classes
namespace Gudhi {
// needs namespace for Doxygen to link on classes
-namespace Bottleneck_distance {
+namespace bottleneck_distance {
/** \defgroup bottleneck_distance Bottleneck distance
*
* \author François Godi
+ * @{
*
+ * \section bottleneckdefinition Definition
+ *
+ * Bottleneck distance is blablabla...
*/
+/** @} */ // end defgroup bottleneck_distance
-} // namespace Bottleneck_distance
+} // namespace bottleneck_distance
} // namespace Gudhi
diff --git a/src/Bottleneck_distance/example/bottleneck_example.cpp b/src/Bottleneck_distance/example/bottleneck_example.cpp
index 472c5c84..0bec9746 100644
--- a/src/Bottleneck_distance/example/bottleneck_example.cpp
+++ b/src/Bottleneck_distance/example/bottleneck_example.cpp
@@ -28,12 +28,9 @@
#include <sstream>
#include <string>
-using namespace std;
-
-//PD: I am using this type of procedures a lot in Gudhi stat. We should make one for all at some point.
std::vector< std::pair<double, double> > read_diagram_from_file( const char* filename )
{
- ifstream in;
+ std::ifstream in;
in.open( filename );
std::vector< std::pair<double, double> > result;
if ( !in.is_open() )
@@ -58,13 +55,15 @@ std::vector< std::pair<double, double> > read_diagram_from_file( const char* fil
}
in.close();
return result;
-}//read_diagram_from_file
+} //read_diagram_from_file
int main( int argc , char** argv )
{
if ( argc < 3 )
{
- std::cout << "To run this program please provide as an input two files with persistence diagrams. Each file should contain a birth-death pair per line. Third, optional parameter is an error bound on a bottleneck distance (set by default to zero). The program will now terminate \n";
+ std::cout << "To run this program please provide as an input two files with persistence diagrams. Each file " <<
+ "should contain a birth-death pair per line. Third, optional parameter is an error bound on a bottleneck" <<
+ " distance (set by default to zero). The program will now terminate \n";
}
std::vector< std::pair< double , double > > diag1 = read_diagram_from_file( argv[1] );
std::vector< std::pair< double , double > > diag2 = read_diagram_from_file( argv[2] );
@@ -73,6 +72,6 @@ int main( int argc , char** argv )
{
tolerance = atof( argv[3] );
}
- double b = Gudhi::Bottleneck_distance::compute(diag1, diag2, tolerance);
+ double b = Gudhi::bottleneck_distance::compute(diag1, diag2, tolerance);
std::cout << "The distance between the diagrams is : " << b << ". The tolerace is : " << tolerance << std::endl;
}
diff --git a/src/Bottleneck_distance/include/gudhi/CGAL/Miscellaneous.h b/src/Bottleneck_distance/include/gudhi/CGAL/Miscellaneous.h
index 21be0bc7..91632149 100644
--- a/src/Bottleneck_distance/include/gudhi/CGAL/Miscellaneous.h
+++ b/src/Bottleneck_distance/include/gudhi/CGAL/Miscellaneous.h
@@ -27,7 +27,7 @@
namespace CGAL {
-typedef Gudhi::Bottleneck_distance::Internal_point Internal_point;
+typedef Gudhi::bottleneck_distance::Internal_point Internal_point;
template <>
struct Kernel_traits<Internal_point> {
diff --git a/src/Bottleneck_distance/include/gudhi/Graph_matching.h b/src/Bottleneck_distance/include/gudhi/Graph_matching.h
index 7a8c8ee0..5f579a0c 100644
--- a/src/Bottleneck_distance/include/gudhi/Graph_matching.h
+++ b/src/Bottleneck_distance/include/gudhi/Graph_matching.h
@@ -20,8 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef SRC_BOTTLENECK_INCLUDE_GUDHI_GRAPH_MATCHING_H_
-#define SRC_BOTTLENECK_INCLUDE_GUDHI_GRAPH_MATCHING_H_
+#ifndef GRAPH_MATCHING_H_
+#define GRAPH_MATCHING_H_
#include <deque>
@@ -29,7 +29,7 @@
namespace Gudhi {
-namespace Bottleneck_distance {
+namespace bottleneck_distance {
/** \brief Function to use in order to compute the Bottleneck distance between two persistence diagrams. You get an additive e-approximation.
*
@@ -238,11 +238,11 @@ double compute(const Persistence_diagram1 &diag1, const Persistence_diagram2 &di
-} // namespace Bottleneck_distance
+} // namespace bottleneck_distance
} // namespace Gudhi
-#endif // SRC_BOTTLENECK_INCLUDE_GUDHI_GRAPH_MATCHING_H_
+#endif // GRAPH_MATCHING_H_
/* Dichotomic version
template<typename Persistence_diagram1, typename Persistence_diagram2>
diff --git a/src/Bottleneck_distance/include/gudhi/Internal_point.h b/src/Bottleneck_distance/include/gudhi/Internal_point.h
index 2080900d..f05d5fc9 100644
--- a/src/Bottleneck_distance/include/gudhi/Internal_point.h
+++ b/src/Bottleneck_distance/include/gudhi/Internal_point.h
@@ -20,12 +20,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef SRC_BOTTLENECK_INCLUDE_GUDHI_INTERNAL_POINT_H_
-#define SRC_BOTTLENECK_INCLUDE_GUDHI_INTERNAL_POINT_H_
+#ifndef INTERNAL_POINT_H_
+#define INTERNAL_POINT_H_
namespace Gudhi {
-namespace Bottleneck_distance {
+namespace bottleneck_distance {
/** \internal \brief Returns the used index for encoding none of the points */
int null_point_index();
@@ -67,8 +67,8 @@ inline int null_point_index() {
return -1;
}
-} // namespace Bottleneck_distance
+} // namespace bottleneck_distance
} // namespace Gudhi
-#endif // SRC_BOTTLENECK_INCLUDE_GUDHI_INTERNAL_POINT_H_
+#endif // INTERNAL_POINT_H_
diff --git a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
index 7ad79126..1bd5879c 100644
--- a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
+++ b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
@@ -20,15 +20,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef SRC_BOTTLENECK_INCLUDE_GUDHI_NEIGHBORS_FINDER_H_
-#define SRC_BOTTLENECK_INCLUDE_GUDHI_NEIGHBORS_FINDER_H_
+#ifndef NEIGHBORS_FINDER_H_
+#define NEIGHBORS_FINDER_H_
#include <unordered_set>
#include <gudhi/Planar_neighbors_finder.h>
namespace Gudhi {
-namespace Bottleneck_distance {
+namespace bottleneck_distance {
/** \internal \brief data structure used to find any point (including projections) in V near to a query point from U
* (which can be a projection).
@@ -147,8 +147,8 @@ inline int Layered_neighbors_finder::vlayers_number() const {
return static_cast<int>(neighbors_finder.size());
}
-} // namespace Bottleneck_distance
+} // namespace bottleneck_distance
} // namespace Gudhi
-#endif // SRC_BOTTLENECK_INCLUDE_GUDHI_NEIGHBORS_FINDER_H_
+#endif // NEIGHBORS_FINDER_H_
diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h
index e31b2dae..1f6d6683 100644
--- a/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h
+++ b/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h
@@ -20,8 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef SRC_BOTTLENECK_INCLUDE_GUDHI_PERSISTENCE_DIAGRAMS_GRAPH_H_
-#define SRC_BOTTLENECK_INCLUDE_GUDHI_PERSISTENCE_DIAGRAMS_GRAPH_H_
+#ifndef PERSISTENCE_DIAGRAMS_GRAPH_H_
+#define PERSISTENCE_DIAGRAMS_GRAPH_H_
#include <vector>
#include <set>
@@ -34,7 +34,7 @@
namespace Gudhi {
-namespace Bottleneck_distance {
+namespace bottleneck_distance {
/** \internal \brief Structure representing an euclidean bipartite graph containing
@@ -162,8 +162,8 @@ inline double G::diameter() {
return max;
}
-} // namespace Bottleneck_distance
+} // namespace bottleneck_distance
} // namespace Gudhi
-#endif // SRC_BOTTLENECK_INCLUDE_GUDHI_PERSISTENCE_DIAGRAMS_GRAPH_H_
+#endif // PERSISTENCE_DIAGRAMS_GRAPH_H_
diff --git a/src/Bottleneck_distance/include/gudhi/Planar_neighbors_finder.h b/src/Bottleneck_distance/include/gudhi/Planar_neighbors_finder.h
index 30f7dc3c..bf70ed0b 100644
--- a/src/Bottleneck_distance/include/gudhi/Planar_neighbors_finder.h
+++ b/src/Bottleneck_distance/include/gudhi/Planar_neighbors_finder.h
@@ -20,8 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef SRC_BOTTLENECK_INCLUDE_GUDHI_PLANAR_NEIGHBORS_FINDER_H_
-#define SRC_BOTTLENECK_INCLUDE_GUDHI_PLANAR_NEIGHBORS_FINDER_H_
+#ifndef PLANAR_NEIGHBORS_FINDER_H_
+#define PLANAR_NEIGHBORS_FINDER_H_
#include <list>
#include <map>
@@ -40,7 +40,7 @@
namespace Gudhi {
-namespace Bottleneck_distance {
+namespace bottleneck_distance {
/** \internal \brief Structure used to find any point in V near (according to the planar distance) to a query point from U.
*
@@ -217,8 +217,8 @@ inline std::shared_ptr< std::list<int> > Cgal_pnf::pull_all_near(int u_point_ind
}
-} // namespace Bottleneck_distance
+} // namespace bottleneck_distance
} // namespace Gudhi
-#endif // SRC_BOTTLENECK_INCLUDE_GUDHI_PLANAR_NEIGHBORS_FINDER_H_
+#endif // PLANAR_NEIGHBORS_FINDER_H_
diff --git a/src/Bottleneck_distance/test/bottleneck_chrono.cpp b/src/Bottleneck_distance/test/bottleneck_chrono.cpp
index 8b49b6be..8b143b18 100644
--- a/src/Bottleneck_distance/test/bottleneck_chrono.cpp
+++ b/src/Bottleneck_distance/test/bottleneck_chrono.cpp
@@ -24,7 +24,7 @@
#include <chrono>
#include <fstream>
-using namespace Gudhi::Bottleneck_distance;
+using namespace Gudhi::bottleneck_distance;
double upper_bound = 400.; // any real >0
diff --git a/src/Bottleneck_distance/test/bottleneck_unit_test.cpp b/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
index d5b71156..d2331c5d 100644
--- a/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
+++ b/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
@@ -27,7 +27,7 @@
#include <random>
#include <gudhi/Graph_matching.h>
-using namespace Gudhi::Bottleneck_distance;
+using namespace Gudhi::bottleneck_distance;
int n1 = 81; // a natural number >0
int n2 = 180; // a natural number >0
diff --git a/src/cmake/modules/GUDHI_user_version_target.txt b/src/cmake/modules/GUDHI_user_version_target.txt
index 805f0a83..de16ef4c 100644
--- a/src/cmake/modules/GUDHI_user_version_target.txt
+++ b/src/cmake/modules/GUDHI_user_version_target.txt
@@ -48,7 +48,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.11)
add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_SOURCE_DIR}/src/GudhUI ${GUDHI_USER_VERSION_DIR}/GudhUI)
- set(GUDHI_MODULES "common;Alpha_complex;Bitmap_cubical_complex;Contraction;Hasse_complex;Persistent_cohomology;Simplex_tree;Skeleton_blocker;Witness_complex")
+ set(GUDHI_MODULES "common;Alpha_complex;Bitmap_cubical_complex;Bottleneck_distance;Contraction;Hasse_complex;Persistent_cohomology;Simplex_tree;Skeleton_blocker;Witness_complex")
foreach(GUDHI_MODULE ${GUDHI_MODULES})
# doc files