summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-15 10:00:19 +0000
committerfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-15 10:00:19 +0000
commit9906477eb45f16cfafe7186482f4c44606c575dc (patch)
tree86d89ee1a46fa0ee063366152778a15cfb09448a
parent524652d3a8a46dd9749821ad2e7684937179d4eb (diff)
namespace
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneck_integration@1877 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 0d15f01525272ec8bea7436fa18dbac213becf0a
-rw-r--r--src/Bottleneck_distance/example/bottleneck_basic_example.cpp4
-rw-r--r--src/Bottleneck_distance/example/bottleneck_read_file_example.cpp2
-rw-r--r--src/Bottleneck_distance/include/gudhi/Bottleneck.h6
-rw-r--r--src/Bottleneck_distance/include/gudhi/Graph_matching.h4
-rw-r--r--src/Bottleneck_distance/include/gudhi/Internal_point.h4
-rw-r--r--src/Bottleneck_distance/include/gudhi/Neighbors_finder.h4
-rw-r--r--src/Bottleneck_distance/include/gudhi/Persistence_graph.h4
-rw-r--r--src/Bottleneck_distance/test/bottleneck_chrono.cpp6
-rw-r--r--src/Bottleneck_distance/test/bottleneck_unit_test.cpp8
9 files changed, 21 insertions, 21 deletions
diff --git a/src/Bottleneck_distance/example/bottleneck_basic_example.cpp b/src/Bottleneck_distance/example/bottleneck_basic_example.cpp
index 95548579..78e00e57 100644
--- a/src/Bottleneck_distance/example/bottleneck_basic_example.cpp
+++ b/src/Bottleneck_distance/example/bottleneck_basic_example.cpp
@@ -37,11 +37,11 @@ int main() {
v2.emplace_back(3.2, std::numeric_limits<double>::infinity());
- double b = Gudhi::bottleneck_distance::compute(v1, v2);
+ double b = Gudhi::persistence_diagram::bottleneck_distance(v1, v2);
std::cout << "Bottleneck distance = " << b << std::endl;
- b = Gudhi::bottleneck_distance::compute(v1, v2, 0.1);
+ b = Gudhi::persistence_diagram::bottleneck_distance(v1, v2, 0.1);
std::cout << "Approx bottleneck distance = " << b << std::endl;
diff --git a/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp b/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp
index 4a503e4c..ceedccc5 100644
--- a/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp
+++ b/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp
@@ -72,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::persistence_diagram::bottleneck_distance(diag1, diag2, tolerance);
std::cout << "The distance between the diagrams is : " << b << ". The tolerance is : " << tolerance << std::endl;
}
diff --git a/src/Bottleneck_distance/include/gudhi/Bottleneck.h b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
index 4a69fb96..0c9e5ea8 100644
--- a/src/Bottleneck_distance/include/gudhi/Bottleneck.h
+++ b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
@@ -28,7 +28,7 @@
namespace Gudhi {
-namespace bottleneck_distance {
+namespace persistence_diagram {
/** \brief Function to use in order to compute the Bottleneck distance between two persistence diagrams (see Concepts).
* If the last parameter e is not 0 (default value if not explicited), you get an additive e-approximation.
@@ -36,7 +36,7 @@ namespace bottleneck_distance {
* \ingroup bottleneck_distance
*/
template<typename Persistence_diagram1, typename Persistence_diagram2>
-double compute(const Persistence_diagram1 &diag1, const Persistence_diagram2 &diag2, double e=0.) {
+double bottleneck_distance(const Persistence_diagram1 &diag1, const Persistence_diagram2 &diag2, double e=0.) {
Persistence_graph g(diag1, diag2, e);
double b = g.bottleneck_alive();
if(b == std::numeric_limits<double>::infinity())
@@ -69,7 +69,7 @@ double compute(const Persistence_diagram1 &diag1, const Persistence_diagram2 &di
-} // namespace bottleneck_distance
+} // namespace persistence_diagram
} // namespace Gudhi
diff --git a/src/Bottleneck_distance/include/gudhi/Graph_matching.h b/src/Bottleneck_distance/include/gudhi/Graph_matching.h
index 10b7073a..e9f455d7 100644
--- a/src/Bottleneck_distance/include/gudhi/Graph_matching.h
+++ b/src/Bottleneck_distance/include/gudhi/Graph_matching.h
@@ -27,7 +27,7 @@
namespace Gudhi {
-namespace bottleneck_distance {
+namespace persistence_diagram {
/** \internal \brief Structure representing a graph matching. The graph is a Persistence_diagrams_graph.
*
@@ -172,7 +172,7 @@ inline void Graph_matching::update(std::vector<int>& path) {
}
-} // namespace bottleneck_distance
+} // namespace persistence_diagram
} // namespace Gudhi
diff --git a/src/Bottleneck_distance/include/gudhi/Internal_point.h b/src/Bottleneck_distance/include/gudhi/Internal_point.h
index 27a59d3f..70342d0c 100644
--- a/src/Bottleneck_distance/include/gudhi/Internal_point.h
+++ b/src/Bottleneck_distance/include/gudhi/Internal_point.h
@@ -25,7 +25,7 @@
namespace Gudhi {
-namespace bottleneck_distance {
+namespace persistence_diagram {
/** \internal \brief Returns the used index for encoding none of the points */
int null_point_index();
@@ -59,7 +59,7 @@ struct Construct_coord_iterator {
{ return p.vec+2; }
};
-} // namespace bottleneck_distance
+} // namespace persistence_diagram
} // namespace Gudhi
diff --git a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
index e6acafc6..792925b7 100644
--- a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
+++ b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
@@ -38,7 +38,7 @@
namespace Gudhi {
-namespace bottleneck_distance {
+namespace persistence_diagram {
/** \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).
@@ -162,7 +162,7 @@ inline int Layered_neighbors_finder::vlayers_number() const {
return static_cast<int>(neighbors_finder.size());
}
-} // namespace bottleneck_distance
+} // namespace persistence_diagram
} // namespace Gudhi
diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
index f16a6c95..2ee55995 100644
--- a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
+++ b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
@@ -29,7 +29,7 @@
namespace Gudhi {
-namespace bottleneck_distance {
+namespace persistence_diagram {
/** \internal \brief Structure representing an euclidean bipartite graph containing
@@ -172,7 +172,7 @@ inline double Persistence_graph::diameter_bound() const {
}
-} // namespace bottleneck_distance
+} // namespace persistence_diagram
} // namespace Gudhi
diff --git a/src/Bottleneck_distance/test/bottleneck_chrono.cpp b/src/Bottleneck_distance/test/bottleneck_chrono.cpp
index 8bd41104..f51714a2 100644
--- a/src/Bottleneck_distance/test/bottleneck_chrono.cpp
+++ b/src/Bottleneck_distance/test/bottleneck_chrono.cpp
@@ -25,7 +25,7 @@
#include <fstream>
#include <random>
-using namespace Gudhi::bottleneck_distance;
+using namespace Gudhi::persistence_diagram;
double upper_bound = 400.; // any real >0
@@ -34,7 +34,7 @@ int main(){
std::ofstream objetfichier;
objetfichier.open("results.csv", std::ios::out);
- for(int n = 400; n<=2000; n+=400){
+ for(int n = 1000; n<=4000; n+=1000){
std::uniform_real_distribution<double> unif1(0.,upper_bound);
std::uniform_real_distribution<double> unif2(upper_bound/1000.,upper_bound/100.);
std::default_random_engine re;
@@ -52,7 +52,7 @@ int main(){
v2.emplace_back(std::max(a,b),std::max(a,b)+y);
}
std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now();
- double b = compute(v1,v2, 0.00001);
+ double b = bottleneck_distance(v1,v2, 0.00001);
std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
typedef std::chrono::duration<int,std::milli> millisecs_t;
millisecs_t duration(std::chrono::duration_cast<millisecs_t>(end-start));
diff --git a/src/Bottleneck_distance/test/bottleneck_unit_test.cpp b/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
index 2e67d436..fba1d369 100644
--- a/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
+++ b/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
@@ -28,7 +28,7 @@
#include <random>
#include <gudhi/Bottleneck.h>
-using namespace Gudhi::bottleneck_distance;
+using namespace Gudhi::persistence_diagram;
int n1 = 81; // a natural number >0
int n2 = 180; // a natural number >0
@@ -161,7 +161,7 @@ BOOST_AUTO_TEST_CASE(global){
if(i%3==0)
v2.emplace_back(std::max(a,b),std::max(a,b)+y);
}
- BOOST_CHECK(compute(v1, v2) <= upper_bound/100.);
- BOOST_CHECK(compute(v1, v2, upper_bound/10000.) <= upper_bound/100. + upper_bound/10000.);
- BOOST_CHECK(std::abs(compute(v1, v2) - compute(v1, v2, upper_bound/10000.)) <= upper_bound/10000.);
+ BOOST_CHECK(bottleneck_distance(v1, v2, 0.) <= upper_bound/100.);
+ BOOST_CHECK(bottleneck_distance(v1, v2, upper_bound/10000.) <= upper_bound/100. + upper_bound/10000.);
+ BOOST_CHECK(std::abs(bottleneck_distance(v1, v2, 0.) - bottleneck_distance(v1, v2, upper_bound/10000.)) <= upper_bound/10000.);
}