summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Bauer <mail@ulrich-bauer.org>2018-03-28 15:30:59 +0200
committerUlrich Bauer <mail@ulrich-bauer.org>2018-03-28 15:30:59 +0200
commit492fb75554bf60bccc36c8af98e0bc93b02a612b (patch)
tree24f0a879818b5035dfcfb4f8e49dcba9b5d9f71d
parentf5888f68260b871d2d9596fbc7eb52edc0c16400 (diff)
output dim 0 cocycles
-rw-r--r--ripser.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/ripser.cpp b/ripser.cpp
index bdf8ff9..b98af75 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -1015,6 +1015,19 @@ void ripser::compute_barcodes() {
if (get_diameter(e) != 0)
std::cout << " [0," << get_diameter(e) << ")" << std::endl;
#endif
+ std::cout << "{";
+ bool nonempty = false;
+ for (index_t w = 0; w < n; ++w)
+ if (dset.find(w) == u) {
+ if (nonempty) std::cout << ", "; nonempty = true;
+ std::cout << "[" << w << "]";
+#ifdef USE_COEFFICIENTS
+ std::cout << ":" << 1;
+#endif
+ }
+ std::cout << "}" << std::endl;
+
+
dset.link(u, v);
} else
columns_to_reduce.push_back(e);
@@ -1023,10 +1036,21 @@ void ripser::compute_barcodes() {
#ifdef PRINT_PERSISTENCE_PAIRS
for (index_t i = 0; i < n; ++i)
- if (dset.find(i) == i) std::cout << " [0, )" << std::endl << std::flush;
+ if (dset.find(i) == i) {
+ std::cout << " [0, )" << std::endl << std::flush;
+ std::cout << "{";
+ for (index_t w = 0; w < n; ++w) {
+ if (w > 0) std::cout << ", ";
+ std::cout << "[" << w << "]";
+#ifdef USE_COEFFICIENTS
+ std::cout << ":" << 1;
#endif
- }
-
+ }
+ std::cout << "}" << std::endl;
+#endif
+ }
+ }
+
for (index_t dim = 1; dim <= dim_max; ++dim) {
hash_map<index_t, index_t> pivot_column_index;
pivot_column_index.reserve(columns_to_reduce.size());