diff options
Diffstat (limited to 'src/bool/lucky')
-rw-r--r-- | src/bool/lucky/luckyInt.h | 28 | ||||
-rw-r--r-- | src/bool/lucky/luckySwapIJ.c | 2 |
2 files changed, 17 insertions, 13 deletions
diff --git a/src/bool/lucky/luckyInt.h b/src/bool/lucky/luckyInt.h index 4801b961..f236693c 100644 --- a/src/bool/lucky/luckyInt.h +++ b/src/bool/lucky/luckyInt.h @@ -24,13 +24,16 @@ #include <math.h> #include <time.h> - // comment out this line to run Lucky Code outside of ABC #define _RUNNING_ABC_ #ifdef _RUNNING_ABC_ + #include "misc/util/abc_global.h" +#include "lucky.h" + #else + #define ABC_NAMESPACE_HEADER_START #define ABC_NAMESPACE_HEADER_END #define ABC_NAMESPACE_IMPL_START @@ -42,6 +45,18 @@ typedef unsigned __int64 word; #define inline __inline // compatible with MS VS 6.0 #define ABC_ALLOC(type, num) ((type *) malloc(sizeof(type) * (num))) // #define LUCKY_VERIFY + +typedef struct +{ + int varN; + int* swapArray; + int swapCtr; + int totalSwaps; + int* flipArray; + int flipCtr; + int totalFlips; +}permInfo; + #endif @@ -71,17 +86,6 @@ typedef struct int positionToSwap2; } swapInfo; -typedef struct -{ - int varN; - int* swapArray; - int swapCtr; - int totalSwaps; - int* flipArray; - int flipCtr; - int totalFlips; -}permInfo; - static inline void TimePrint( char* Message ) { diff --git a/src/bool/lucky/luckySwapIJ.c b/src/bool/lucky/luckySwapIJ.c index 9901f9cb..d1170f45 100644 --- a/src/bool/lucky/luckySwapIJ.c +++ b/src/bool/lucky/luckySwapIJ.c @@ -76,7 +76,7 @@ void swap_ij_case3( word* f,int totalVars, int i, int j) shift = (wwj - wwi)/2; WORDS_IN_TT = Kit_TruthWordNum_64bit(totalVars); SizeOfBlock = sizeof(word)*wwi/2; - temp = malloc(SizeOfBlock); + temp = (word *)malloc(SizeOfBlock); for(y=wwj/2; y<WORDS_IN_TT; y+=wwj) for(x=y-shift; x<y; x+=wwi) { |