diff options
author | Arnur Nigmetov <nigmetov@tugraz.at> | 2020-01-14 16:17:43 +0100 |
---|---|---|
committer | Arnur Nigmetov <nigmetov@tugraz.at> | 2020-01-14 16:17:43 +0100 |
commit | ce3a42a493f63eb5b23e8a293bf995abaa1cb9e8 (patch) | |
tree | a14946cf930882753dedda34e45fd87addc69c9c /matching/include/phat/compute_persistence_pairs.h | |
parent | 185378614231d1f4b04cf72ec785896cbdd43e39 (diff) |
Interim: matching distance for modules
1. Templatize DistanceCalculator (DiagramProvider)
2. Add BifiltrationProxy with the same interface as ModulePresentation
(dimension fixed).
3. Call Hera with relative error.
4. Add class ModulePresentation.
To-Do: reading module presentations from Rivet format.
Diffstat (limited to 'matching/include/phat/compute_persistence_pairs.h')
-rw-r--r-- | matching/include/phat/compute_persistence_pairs.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/matching/include/phat/compute_persistence_pairs.h b/matching/include/phat/compute_persistence_pairs.h index 48be65c..06f5372 100644 --- a/matching/include/phat/compute_persistence_pairs.h +++ b/matching/include/phat/compute_persistence_pairs.h @@ -97,14 +97,23 @@ namespace phat { ReductionAlgorithm reduce; reduce( boundary_matrix ); pairs.clear(); + std::set<index> max_indices; + // finite pairs for( index idx = 0; idx < boundary_matrix.get_num_cols(); idx++ ) { if( !boundary_matrix.is_empty( idx ) ) { index birth = boundary_matrix.get_max_index( idx ); + max_indices.insert(birth); index death = idx; pairs.append_pair( birth, death ); } } - } + // infinite pairs: column idx is 0, and row idx does not contain a lowest one + for( index idx = 0; idx < boundary_matrix.get_num_cols(); idx++ ) { + if(boundary_matrix.is_empty(idx) && max_indices.count(idx) == 0 ) { + pairs.append_pair( idx, k_infinity_index); + } + } + } template< typename ReductionAlgorithm, typename Representation > void compute_persistence_pairs_dualized( persistence_pairs& pairs, boundary_matrix< Representation >& boundary_matrix ) { |