Commit b6702fc2 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

[buddy] Speedup hash functions.

* src/kernel.h (PAIR, TRIPLE): Redefine these hash functions
using something that is simpler to compute.
parent 4ba60dad
2011-11-12 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* src/kernel.h (PAIR, TRIPLE): Redefine these hash functions using
something that is simpler to compute.
2011-08-28 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* examples/adder/adder.cxx (test_vector): Add parentheses to
......
......@@ -153,9 +153,8 @@ extern bddCacheStat bddcachestats;
/* Hashfunctions */
#define PAIR(a,b) ((unsigned int)((((unsigned int)a)+((unsigned int)b))*(((unsigned int)a)+((unsigned int)b)+((unsigned int)1))/((unsigned int)2)+((unsigned int)a)))
#define TRIPLE(a,b,c) ((unsigned int)(PAIR((unsigned int)c,PAIR(a,b))))
#define PAIR(a,b) (((unsigned)a)+((unsigned)b)*12582917U)
#define TRIPLE(a,b,c) (((unsigned)a)+((unsigned)b)*12582917U+((unsigned)c)*4256249U)
/* Inspection of BDD nodes */
#define ISCONST(a) ((a) < 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment