diff options
author | Ulrich Bauer <mail@ulrich-bauer.org> | 2018-03-28 15:30:59 +0200 |
---|---|---|
committer | Ulrich Bauer <mail@ulrich-bauer.org> | 2018-03-28 15:30:59 +0200 |
commit | 492fb75554bf60bccc36c8af98e0bc93b02a612b (patch) | |
tree | 24f0a879818b5035dfcfb4f8e49dcba9b5d9f71d | |
parent | f5888f68260b871d2d9596fbc7eb52edc0c16400 (diff) |
output dim 0 cocycles
-rw-r--r-- | ripser.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
@@ -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()); |