Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
threshold at enclosing radius
  • Loading branch information
ubauer committed Feb 15, 2018
1 parent a962f06 commit 23a262f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ripser.cpp
Expand Up @@ -785,9 +785,8 @@ template <> class ripser<sparse_distance_matrix>::simplex_coboundary_enumerator
else
x = std::max(x, y);
}
return all_cofaces ||
!(k > 0 &&
parent.get_next_vertex(max_vertex_below, idx_below, k) > get_index(x));
return all_cofaces || !(k > 0 && parent.get_next_vertex(max_vertex_below, idx_below,
k) > get_index(x));
continue_outer:;
}
return false;
Expand Down Expand Up @@ -1151,6 +1150,15 @@ int main(int argc, char** argv) {
max = -std::numeric_limits<value_t>::infinity(), max_finite = max;
int num_edges = 0;

value_t enclosing_radius = std::numeric_limits<value_t>::infinity();
for (index_t i = 0; i < dist.size(); ++i) {
value_t r_i = -std::numeric_limits<value_t>::infinity();
for (index_t j = 0; j < dist.size(); ++j) r_i = std::max(r_i, dist(i, j));
enclosing_radius = std::min(enclosing_radius, r_i);
}

if (threshold == std::numeric_limits<value_t>::max()) threshold = enclosing_radius;

for (auto d : dist.distances) {
min = std::min(min, d);
max = std::max(max, d);
Expand Down

0 comments on commit 23a262f

Please sign in to comment.