diff options
author | Ulrich Bauer <mail@ulrich-bauer.org> | 2016-08-24 10:52:21 +0200 |
---|---|---|
committer | Ulrich Bauer <mail@ulrich-bauer.org> | 2016-08-24 10:52:21 +0200 |
commit | 97a760c54be95cb949d1e9c25f9e4513982f8109 (patch) | |
tree | 5259e0aedabae0fe94da45f2fcb376331f66cbc8 | |
parent | a76f7e89dd7f9833265147964d2f10c4cfd7e7bf (diff) |
fixed compressed_distance_matrix access
-rw-r--r-- | ripser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -309,12 +309,12 @@ template <> void compressed_distance_matrix<UPPER_TRIANGULAR>::init_rows() { } template <> value_t compressed_distance_matrix<UPPER_TRIANGULAR>::operator()(index_t i, index_t j) const { - std::tie(i, j) = std::minmax(i, j); + if (i > j) std::swap(i, j); return i == j ? 0 : rows[i][j]; } template <> value_t compressed_distance_matrix<LOWER_TRIANGULAR>::operator()(index_t i, index_t j) const { - std::tie(i, j) = std::minmax(i, j); + if (i > j) std::swap(i, j); return i == j ? 0 : rows[j][i]; } |