Skip to content

Commit

Permalink
Enable enclosing radius when threshold is set to infinity
Browse files Browse the repository at this point in the history
Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
  • Loading branch information
julian committed Oct 12, 2020
1 parent 96559f4 commit 4aac65c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- Update C++ backend to commit 286d369 of [ripser](https://github.com/Ripser/ripser) but keeping same functionalities
- Add support to robinhood hashmap into the C++ Backend
- Update CI in order to compile C++ with robinhood enable
- Enable Enclosing radius when threshold is set to infinity

# 0.5.4
- Fixing issue with inconsistent answers from different scipy.sparse formats, courtesy of Umberto Lupo
Expand Down
7 changes: 5 additions & 2 deletions ripser/ripser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ struct PACK entry_t {
entry_t() : index(0), coefficient(0) {}
};


/* This assert fails on windows due to the support of packed structures */
#ifndef _MSC_VER
static_assert(sizeof(entry_t) == sizeof(index_t),
Expand Down Expand Up @@ -1147,7 +1146,11 @@ ripserResults rips_dm(float* D, int N, int modulus, int dim_max,
max = -std::numeric_limits<value_t>::infinity(), max_finite = max;
int num_edges = 0;

if (threshold == std::numeric_limits<value_t>::max()) {
/* Use enclosing radius when users does not set threshold or
* when users uses infinity as a threshold
*/
if (threshold == std::numeric_limits<value_t>::max() ||
threshold == std::numeric_limits<value_t>::infinity()) {
value_t enclosing_radius = std::numeric_limits<value_t>::infinity();
for (size_t i = 0; i < dist.size(); ++i) {
value_t r_i = -std::numeric_limits<value_t>::infinity();
Expand Down

0 comments on commit 4aac65c

Please sign in to comment.