summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Bauer <mail@ulrich-bauer.org>2016-08-24 10:52:21 +0200
committerUlrich Bauer <mail@ulrich-bauer.org>2016-08-24 10:52:21 +0200
commit97a760c54be95cb949d1e9c25f9e4513982f8109 (patch)
tree5259e0aedabae0fe94da45f2fcb376331f66cbc8
parenta76f7e89dd7f9833265147964d2f10c4cfd7e7bf (diff)
fixed compressed_distance_matrix access
-rw-r--r--ripser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ripser.cpp b/ripser.cpp
index d3c5127..ec58cb2 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -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];
}