diff options
author | Ulrich Bauer <ulrich.bauer@tum.de> | 2016-05-24 17:30:06 +0200 |
---|---|---|
committer | Ulrich Bauer <ulrich.bauer@tum.de> | 2016-05-24 17:30:06 +0200 |
commit | 8d1d76d2b932b36cc788950e3cbdf2f67d3dce44 (patch) | |
tree | 2323db0df3570f8ffa2c5d65f866618401f70070 | |
parent | bb8a173be181d3035e6523cb38a4eec526c4bd71 (diff) |
removed binary/exponential search flags
-rw-r--r-- | ripser.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
@@ -1,6 +1,3 @@ -#define USE_BINARY_SEARCH -//#define USE_EXPONENTIAL_SEARCH - //#define ASSEMBLE_REDUCTION_MATRIX //#define USE_COEFFICIENTS @@ -70,18 +67,8 @@ inline OutputIterator get_simplex_vertices(index_t idx, const index_t dim, index --n; for (index_t k = dim + 1; k > 0; --k) { - -#ifdef USE_BINARY_SEARCH 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 - + index_t count = n; while (count > 0) { index_t i = n; index_t step = count >> 1; @@ -93,15 +80,10 @@ inline OutputIterator get_simplex_vertices(index_t idx, const index_t dim, index count = step; } } -#else - while (binomial_coeff(n, k) > idx) --n; -#endif - assert(binomial_coeff(n, k) <= idx); assert(binomial_coeff(n + 1, k) > idx); *out++ = n; - idx -= binomial_coeff(n, k); } |