diff options
author | Ulrich Bauer <ulrich.bauer@tum.de> | 2016-07-20 08:34:59 +0200 |
---|---|---|
committer | Ulrich Bauer <ulrich.bauer@tum.de> | 2016-07-20 08:41:51 +0200 |
commit | 12b8e1109a569e2dad5962dc806b3dee6f0d7e4f (patch) | |
tree | cdf3b336ab327d2a8e40a2419e7310a662975280 | |
parent | 9819beb08cba5ba95d513bed4390c8c747a1ae66 (diff) |
progress indicator for sorting
-rw-r--r-- | ripser.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -401,6 +401,11 @@ void assemble_columns_to_reduce(std::vector<diameter_index_t>& columns_to_reduce columns_to_reduce.clear(); +#ifdef INDICATE_PROGRESS + std::cout << "\033[K" + << "assembling " << num_simplices << " columns" << std::flush << "\r"; +#endif + for (index_t index = 0; index < num_simplices; ++index) { if (pivot_column_index.find(index) == pivot_column_index.end()) { value_t diameter = comp.diameter(index); @@ -408,8 +413,16 @@ void assemble_columns_to_reduce(std::vector<diameter_index_t>& columns_to_reduce } } +#ifdef INDICATE_PROGRESS + std::cout << "\033[K" + << "sorting " << num_simplices << " columns" << std::flush << "\r"; +#endif + std::sort(columns_to_reduce.begin(), columns_to_reduce.end(), greater_diameter_or_smaller_index<diameter_index_t>()); +#ifdef INDICATE_PROGRESS + std::cout << "\033[K"; +#endif } template <typename ValueType> class compressed_sparse_matrix { @@ -496,9 +509,10 @@ void compute_pairs(std::vector<diameter_index_t>& columns_to_reduce, value_t diameter = get_diameter(column_to_reduce); #ifdef INDICATE_PROGRESS - std::cout << "\033[K" - << "reducing column " << i + 1 << "/" << columns_to_reduce.size() << " (diameter " - << diameter << ")" << std::flush << "\r"; + if ((i+1) % 1000 == 0) + std::cout << "\033[K" + << "reducing column " << i + 1 << "/" << columns_to_reduce.size() + << " (diameter " << diameter << ")" << std::flush << "\r"; #endif index_t j = i; |