summaryrefslogtreecommitdiff
path: root/src/Alpha_complex/utilities/alpha_complex_persistence.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Alpha_complex/utilities/alpha_complex_persistence.cpp')
-rw-r--r--src/Alpha_complex/utilities/alpha_complex_persistence.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/Alpha_complex/utilities/alpha_complex_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_persistence.cpp
index 486347cc..7c898dfd 100644
--- a/src/Alpha_complex/utilities/alpha_complex_persistence.cpp
+++ b/src/Alpha_complex/utilities/alpha_complex_persistence.cpp
@@ -72,13 +72,10 @@ int main(int argc, char **argv) {
// ----------------------------------------------------------------------------
// Display information about the alpha complex
// ----------------------------------------------------------------------------
- std::cout << "Simplicial complex is of dimension " << simplex.dimension() << " - " << simplex.num_simplices()
+ std::clog << "Simplicial complex is of dimension " << simplex.dimension() << " - " << simplex.num_simplices()
<< " simplices - " << simplex.num_vertices() << " vertices." << std::endl;
- // Sort the simplices in the order of the filtration
- simplex.initialize_filtration();
-
- std::cout << "Simplex_tree dim: " << simplex.dimension() << std::endl;
+ std::clog << "Simplex_tree dim: " << simplex.dimension() << std::endl;
// Compute the persistence diagram of the complex
Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Gudhi::persistent_cohomology::Field_Zp> pcoh(
simplex);
@@ -91,7 +88,7 @@ int main(int argc, char **argv) {
if (output_file_diag.empty()) {
pcoh.output_diagram();
} else {
- std::cout << "Result in file: " << output_file_diag << std::endl;
+ std::clog << "Result in file: " << output_file_diag << std::endl;
std::ofstream out(output_file_diag);
pcoh.output_diagram(out);
out.close();
@@ -114,7 +111,7 @@ void program_options(int argc, char *argv[], std::string &off_file_points, bool
"fast,f", po::bool_switch(&fast),
"To activate fast version of Alpha complex (default is false, not available if exact is set)")(
"output-file,o", po::value<std::string>(&output_file_diag)->default_value(std::string()),
- "Name of file in which the persistence diagram is written. Default print in std::cout")(
+ "Name of file in which the persistence diagram is written. Default print in std::clog")(
"max-alpha-square-value,r", po::value<Filtration_value>(&alpha_square_max_value)
->default_value(std::numeric_limits<Filtration_value>::infinity()),
"Maximal alpha square value for the Alpha complex construction.")(
@@ -135,17 +132,17 @@ void program_options(int argc, char *argv[], std::string &off_file_points, bool
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 an Alpha 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 an Alpha 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);
}
}