summaryrefslogtreecommitdiff
path: root/ripser.cpp
diff options
context:
space:
mode:
authorUlrich Bauer <ulrich.bauer@tum.de>2015-10-22 15:12:28 +0200
committerUlrich Bauer <ulrich.bauer@tum.de>2015-10-22 15:12:28 +0200
commit639c09d9ce8868a47abf6d0fe177812afaa4a365 (patch)
tree24b4847efafe863692b20c88821a5b2200c34062 /ripser.cpp
parent8b982f5ac72792185d31846df5db3b8ad4d0f2fb (diff)
option for exponential search
Diffstat (limited to 'ripser.cpp')
-rw-r--r--ripser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/ripser.cpp b/ripser.cpp
index c4310c5..ab20b8a 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -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;