summaryrefslogtreecommitdiff
path: root/ripser.cpp
diff options
context:
space:
mode:
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;