summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Bauer <mail@ulrich-bauer.org>2016-09-22 16:41:20 +0200
committerUlrich Bauer <mail@ulrich-bauer.org>2016-09-22 16:41:20 +0200
commit5f975621e2d1bb11256abe4df3827bc8bc15754b (patch)
tree445b3e7b1ddcaa24a00ae0531f895b08fd668a56
parentbd64593698d032e7518eb3ee3c3a3b1a0193f66d (diff)
output representative cocycles
-rw-r--r--ripser.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/ripser.cpp b/ripser.cpp
index 3d4eb29..0c31f23 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -37,6 +37,8 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <sstream>
#include <unordered_map>
+#include "prettyprint.hpp"
+
#ifdef USE_GOOGLE_HASHMAP
#include <sparsehash/sparse_hash_map>
template <class Key, class T> class hash_map : public google::sparse_hash_map<Key, T> {
@@ -645,7 +647,13 @@ void compute_pairs(std::vector<diameter_index_t>& columns_to_reduce, hash_map<in
#ifdef INDICATE_PROGRESS
std::cout << "\033[K";
#endif
- std::cout << " [" << diameter << "," << death << ")" << std::endl << std::flush;
+ std::cout << " [" << diameter << "," << death << "): {";
+ while (get_index(pivot = get_pivot(working_coboundary, modulus)) != -1) {
+ std::cout << vertices_of_simplex(get_index(pivot), dim + 1, n, binomial_coeff) << ":" << get_coefficient(pivot);
+ working_coboundary.pop();
+ if (get_index(pivot = get_pivot(working_coboundary, modulus)) != -1) std::cout << ", ";
+ }
+ std::cout << "}" << std::endl;
}
#endif
@@ -954,4 +962,4 @@ int main(int argc, char** argv) {
assemble_columns_to_reduce(columns_to_reduce, pivot_column_index, comp, dim, n, threshold, binomial_coeff);
}
}
-} \ No newline at end of file
+}