summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance
diff options
context:
space:
mode:
Diffstat (limited to 'src/Bottleneck_distance')
-rw-r--r--src/Bottleneck_distance/doc/Intro_bottleneck_distance.h2
-rw-r--r--src/Bottleneck_distance/example/CMakeLists.txt2
-rw-r--r--src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp38
-rw-r--r--src/Bottleneck_distance/example/bottleneck_basic_example.cpp4
-rw-r--r--src/Bottleneck_distance/include/gudhi/Persistence_graph.h2
-rw-r--r--src/Bottleneck_distance/utilities/bottleneck_distance.cpp4
6 files changed, 23 insertions, 29 deletions
diff --git a/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h b/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h
index bbc952e1..2a988b4b 100644
--- a/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h
+++ b/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h
@@ -52,7 +52,7 @@ int main() {
diag2.emplace_back(0., 13.);
double b = Gudhi::persistence_diagram::bottleneck_distance(diag1, diag2);
- std::cout << "Bottleneck distance = " << b << std::endl;
+ std::clog << "Bottleneck distance = " << b << std::endl;
}
* \endcode
*
diff --git a/src/Bottleneck_distance/example/CMakeLists.txt b/src/Bottleneck_distance/example/CMakeLists.txt
index 3d65963a..9839c59d 100644
--- a/src/Bottleneck_distance/example/CMakeLists.txt
+++ b/src/Bottleneck_distance/example/CMakeLists.txt
@@ -13,7 +13,7 @@ endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable (alpha_rips_persistence_bottleneck_distance alpha_rips_persistence_bottleneck_distance.cpp)
- target_link_libraries(alpha_rips_persistence_bottleneck_distance ${Boost_PROGRAM_OPTIONS_LIBRARY})
+ target_link_libraries(alpha_rips_persistence_bottleneck_distance Boost::program_options)
if (TBB_FOUND)
target_link_libraries(alpha_rips_persistence_bottleneck_distance ${TBB_LIBRARIES})
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 6c0dc9bf..ceb9e226 100644
--- a/src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp
+++ b/src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp
@@ -68,12 +68,9 @@ int main(int argc, char * argv[]) {
Simplex_tree rips_stree;
rips_complex.create_complex(rips_stree, dim_max);
- std::cout << "The Rips complex contains " << rips_stree.num_simplices() << " simplices and has dimension "
+ std::clog << "The Rips complex contains " << rips_stree.num_simplices() << " simplices and has dimension "
<< rips_stree.dimension() << " \n";
- // Sort the simplices in the order of the filtration
- rips_stree.initialize_filtration();
-
// Compute the persistence diagram of the complex
Persistent_cohomology rips_pcoh(rips_stree);
// initializes the coefficient field for homology
@@ -89,12 +86,9 @@ int main(int argc, char * argv[]) {
Simplex_tree alpha_stree;
alpha_complex.create_complex(alpha_stree, threshold * threshold);
- std::cout << "The Alpha complex contains " << alpha_stree.num_simplices() << " simplices and has dimension "
+ std::clog << "The Alpha complex contains " << alpha_stree.num_simplices() << " simplices and has dimension "
<< alpha_stree.dimension() << " \n";
- // Sort the simplices in the order of the filtration
- alpha_stree.initialize_filtration();
-
// Compute the persistence diagram of the complex
Persistent_cohomology alpha_pcoh(alpha_stree);
// initializes the coefficient field for homology
@@ -115,12 +109,12 @@ int main(int argc, char * argv[]) {
std::transform(alpha_intervals.begin(), alpha_intervals.end(), alpha_intervals.begin(), compute_root_square);
double bottleneck_distance = Gudhi::persistence_diagram::bottleneck_distance(rips_intervals, alpha_intervals);
- std::cout << "In dimension " << dim << ", bottleneck distance = " << bottleneck_distance << std::endl;
+ std::clog << "In dimension " << dim << ", bottleneck distance = " << bottleneck_distance << std::endl;
if (bottleneck_distance > max_b_distance)
max_b_distance = bottleneck_distance;
}
- std::cout << "================================================================================" << std::endl;
- std::cout << "Bottleneck distance is " << max_b_distance << std::endl;
+ std::clog << "================================================================================" << std::endl;
+ std::clog << "Bottleneck distance is " << max_b_distance << std::endl;
return 0;
}
@@ -162,17 +156,17 @@ void program_options(int argc, char * argv[]
po::notify(vm);
if (vm.count("help") || !vm.count("input-file")) {
- std::cout << std::endl;
- std::cout << "Compute the persistent homology with coefficient field Z/pZ \n";
- std::cout << "of a Rips complex defined on a set of input points.\n \n";
- std::cout << "The output diagram contains one bar per line, written with the convention: \n";
- std::cout << " p dim b d \n";
- std::cout << "where dim is the dimension of the homological feature,\n";
- std::cout << "b and d are respectively the birth and death of the feature and \n";
- std::cout << "p is the characteristic of the field Z/pZ used for homology coefficients." << std::endl << std::endl;
-
- std::cout << "Usage: " << argv[0] << " [options] input-file" << std::endl << std::endl;
- std::cout << visible << std::endl;
+ std::clog << std::endl;
+ std::clog << "Compute the persistent homology with coefficient field Z/pZ \n";
+ std::clog << "of a Rips complex defined on a set of input points.\n \n";
+ std::clog << "The output diagram contains one bar per line, written with the convention: \n";
+ std::clog << " p dim b d \n";
+ std::clog << "where dim is the dimension of the homological feature,\n";
+ std::clog << "b and d are respectively the birth and death of the feature and \n";
+ std::clog << "p is the characteristic of the field Z/pZ used for homology coefficients." << std::endl << std::endl;
+
+ std::clog << "Usage: " << argv[0] << " [options] input-file" << std::endl << std::endl;
+ std::clog << visible << std::endl;
exit(-1);
}
}
diff --git a/src/Bottleneck_distance/example/bottleneck_basic_example.cpp b/src/Bottleneck_distance/example/bottleneck_basic_example.cpp
index 61778a55..e8632a4f 100644
--- a/src/Bottleneck_distance/example/bottleneck_basic_example.cpp
+++ b/src/Bottleneck_distance/example/bottleneck_basic_example.cpp
@@ -20,9 +20,9 @@ int main() {
double b = Gudhi::persistence_diagram::bottleneck_distance(v1, v2);
- std::cout << "Bottleneck distance = " << b << std::endl;
+ std::clog << "Bottleneck distance = " << b << std::endl;
b = Gudhi::persistence_diagram::bottleneck_distance(v1, v2, 0.1);
- std::cout << "Approx bottleneck distance = " << b << std::endl;
+ std::clog << "Approx bottleneck distance = " << b << std::endl;
}
diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
index f791e37c..e1e3522e 100644
--- a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
+++ b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
@@ -25,7 +25,7 @@ namespace Gudhi {
namespace persistence_diagram {
-/** \internal \brief Structure representing an euclidean bipartite graph containing
+/** \internal \brief Structure representing a Euclidean bipartite graph containing
* the points from the two persistence diagrams (including the projections).
*
* \ingroup bottleneck_distance
diff --git a/src/Bottleneck_distance/utilities/bottleneck_distance.cpp b/src/Bottleneck_distance/utilities/bottleneck_distance.cpp
index d88a8a0b..01813ba1 100644
--- a/src/Bottleneck_distance/utilities/bottleneck_distance.cpp
+++ b/src/Bottleneck_distance/utilities/bottleneck_distance.cpp
@@ -18,7 +18,7 @@
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" <<
+ std::clog << "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 the bottleneck" <<
" distance (set by default to the smallest positive double value). If you set the error bound to 0, be" <<
" aware this version is exact but expensive. The program will now terminate \n";
@@ -32,7 +32,7 @@ int main(int argc, char** argv) {
tolerance = atof(argv[3]);
}
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;
+ std::clog << "The distance between the diagrams is : " << b << ". The tolerance is : " << tolerance << std::endl;
return 0;
}