diff --git a/compileTimeOptions.h b/compileTimeOptions.h index 18f3a5158bfaf7646ac88ca9e050047f5b9a519e..32422afb17b9d6fbf2facaefd0f6fb1b20ac74a7 100644 --- a/compileTimeOptions.h +++ b/compileTimeOptions.h @@ -13,7 +13,7 @@ #ifndef OPTIMIZED_MAPPINGS -#define OPTIMIZED_MAPPINGS 0 +#define OPTIMIZED_MAPPINGS 1 #endif #if OPTIMIZED_MAPPINGS #pragma message "OPTIMIZED_MAPPINGS ON" @@ -21,6 +21,18 @@ #pragma message "OPTIMIZED_MAPPINGS off" #endif + +#ifndef OPTIMIZE_COMBINE +#define OPTIMIZE_COMBINE 0 +#endif +#if OPTIMIZE_COMBINE +#pragma message "OPTIMIZE_COMBINE ON" +#else +#pragma message "OPTIMIZE_COMBINE off" +#endif + + + #ifndef MAX_EDGES #define MAX_EDGES 48 #endif diff --git a/fast-array.h b/fast-array.h index 9132595798fe62f1878862c5a77517d93eb13111..1614691b2ad4c974118903690f26ee909ca80213 100644 --- a/fast-array.h +++ b/fast-array.h @@ -26,6 +26,7 @@ struct Mapping { }; +#if OPTIMIZED_MAPPINGS template < size_t i, size_t shift > struct Consts { static const uint64_t clone = (Consts<i-1, shift>::clone << shift) | 1; @@ -84,7 +85,6 @@ struct FastArray { } }; -#if OPTIMIZED_MAPPINGS template <> struct Mapping< Ring::Z4<int> > : public FastArray<true> { Mapping(const Mapping& x) : FastArray(x) {} Mapping(size_t s = 0) : FastArray(s) {} diff --git a/group-connectivity.h b/group-connectivity.h index 1ac5ae19ccc6447eb11920da5348d20d40e5b3a7..8c2f67288a78c18a9c67fe92f98b40af923342e5 100644 --- a/group-connectivity.h +++ b/group-connectivity.h @@ -90,7 +90,9 @@ struct Tester : public AbstractTester { Mapping& cannonize(Mapping& map) { for (const auto &i : nonClassEdges) { +#if OPTIMIZE_COMBINE if (map[i.first] != Ring::zero) +#endif map.combine(map[i.first], i.second); }