summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-03 09:32:46 +0000
committerfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-03 09:32:46 +0000
commit714a97d8b9c64a0a5ccc837184def8122ec8b4cd (patch)
tree8434545761fcf2eba7c7cbbea6110f8257990040 /src
parentab8c111e6a9abc4ba718083266c3dbb238ab94e3 (diff)
compile
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneckDistance@1245 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a26ddc43a1f71052b594d5e0d65d28d952a0917e
Diffstat (limited to 'src')
-rw-r--r--src/Bottleneck_distance/example/bottleneck_example.cpp3
-rw-r--r--src/Bottleneck_distance/include/CGAL/Miscellaneous.h2
-rw-r--r--src/Bottleneck_distance/include/gudhi/Graph_matching.h3
-rw-r--r--src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h4
-rw-r--r--src/Bottleneck_distance/test/bottleneck_chrono.cpp2
-rw-r--r--src/Bottleneck_distance/test/bottleneck_unit_test.cpp2
6 files changed, 9 insertions, 7 deletions
diff --git a/src/Bottleneck_distance/example/bottleneck_example.cpp b/src/Bottleneck_distance/example/bottleneck_example.cpp
index bbd83547..c6a06235 100644
--- a/src/Bottleneck_distance/example/bottleneck_example.cpp
+++ b/src/Bottleneck_distance/example/bottleneck_example.cpp
@@ -23,7 +23,6 @@
#include <gudhi/Graph_matching.h>
#include <iostream>
-using namespace Gudhi::Bottleneck_distance;
int main() {
std::vector< std::pair<double,double> > v1, v2;
@@ -36,7 +35,7 @@ int main() {
v2.push_back(std::pair<double,double>(9.5,14.1));
- double b = bottleneck_distance(v1, v2);
+ double b = Gudhi::Bottleneck_distance::compute(v1, v2);
std::cout << "Bottleneck distance = " << b << std::endl;
diff --git a/src/Bottleneck_distance/include/CGAL/Miscellaneous.h b/src/Bottleneck_distance/include/CGAL/Miscellaneous.h
index 4de787fb..21be0bc7 100644
--- a/src/Bottleneck_distance/include/CGAL/Miscellaneous.h
+++ b/src/Bottleneck_distance/include/CGAL/Miscellaneous.h
@@ -27,7 +27,7 @@
namespace CGAL {
-typedef Gudhi::bipartite_graph_matching::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 d8860841..f0ce633f 100644
--- a/src/Bottleneck_distance/include/gudhi/Graph_matching.h
+++ b/src/Bottleneck_distance/include/gudhi/Graph_matching.h
@@ -40,6 +40,9 @@ namespace Bottleneck_distance {
template<typename Persistence_diagram1, typename Persistence_diagram2>
double compute(const Persistence_diagram1& diag1, const Persistence_diagram2& diag2, double e = 0.);
+template<typename Persistence_diagram1, typename Persistence_diagram2>
+double compute_exactly(const Persistence_diagram1& diag1, const Persistence_diagram2& diag2);
+
/** \internal \brief Structure representing a graph matching. The graph is a Persistence_diagrams_graph.
*
* \ingroup bottleneck_distance
diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h
index e8a46f1c..52e7c583 100644
--- a/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h
+++ b/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h
@@ -154,9 +154,9 @@ inline Internal_point G::get_v_point(int v_point_index) {
inline double G::diameter() {
double max = 0.;
- for(it = u.cbegin(); it != u.cend(); it++)
+ for(auto it = u.cbegin(); it != u.cend(); it++)
max = std::max(max,it->y());
- for(it = v.cbegin(); it != v.cend(); it++)
+ for(auto it = v.cbegin(); it != v.cend(); it++)
max = std::max(max,it->y());
return max;
}
diff --git a/src/Bottleneck_distance/test/bottleneck_chrono.cpp b/src/Bottleneck_distance/test/bottleneck_chrono.cpp
index 8f187a91..cde8afb1 100644
--- a/src/Bottleneck_distance/test/bottleneck_chrono.cpp
+++ b/src/Bottleneck_distance/test/bottleneck_chrono.cpp
@@ -51,7 +51,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 = bottleneck_approx(v1,v2, 0.);
+ double b = compute(v1,v2, 0.01);
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 33ac3f1b..d5b71156 100644
--- a/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
+++ b/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
@@ -184,5 +184,5 @@ BOOST_AUTO_TEST_CASE(global){
if(i%3==0)
v2.emplace_back(std::max(a,b),std::max(a,b)+y);
}
- BOOST_CHECK(bottleneck_distance(v1, v2) <= upper_bound/100.);
+ BOOST_CHECK(compute(v1, v2) <= upper_bound/100.);
}