diff options
author | Ulrich Bauer <ulrich.bauer@tum.de> | 2015-10-22 15:12:28 +0200 |
---|---|---|
committer | Ulrich Bauer <ulrich.bauer@tum.de> | 2015-10-22 15:12:28 +0200 |
commit | 639c09d9ce8868a47abf6d0fe177812afaa4a365 (patch) | |
tree | 24b4847efafe863692b20c88821a5b2200c34062 /ripser.cpp | |
parent | 8b982f5ac72792185d31846df5db3b8ad4d0f2fb (diff) |
option for exponential search
Diffstat (limited to 'ripser.cpp')
-rw-r--r-- | ripser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -16,6 +16,7 @@ typedef long index_t; #define PRECOMPUTE_DIAMETERS_IN_TOP_DIMENSION #define USE_BINARY_SEARCH +#define USE_EXPONENTIAL_SEARCH #define INDICATE_PROGRESS @@ -69,7 +70,11 @@ OutputIterator get_simplex_vertices( index_t idx, const index_t dim, index_t n, if ( binomial_coeff( n , k ) > idx ) { index_t count; + #ifdef USE_EXPONENTIAL_SEARCH for (count = 1; (binomial_coeff( n - count , k ) > idx); count = std::min(count << 1, n)); + #else + count = n; + #endif while (count > 0) { index_t i = n; |