[buddy] Speedup hash functions.
* src/kernel.h (PAIR, TRIPLE): Redefine these hash functions using something that is simpler to compute.
This commit is contained in:
parent
4ba60dad28
commit
b6702fc23a
2 changed files with 7 additions and 3 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2011-08-28 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
||||||
* examples/adder/adder.cxx (test_vector): Add parentheses to
|
* examples/adder/adder.cxx (test_vector): Add parentheses to
|
||||||
|
|
|
||||||
|
|
@ -153,9 +153,8 @@ extern bddCacheStat bddcachestats;
|
||||||
|
|
||||||
/* Hashfunctions */
|
/* 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 PAIR(a,b) (((unsigned)a)+((unsigned)b)*12582917U)
|
||||||
#define TRIPLE(a,b,c) ((unsigned int)(PAIR((unsigned int)c,PAIR(a,b))))
|
#define TRIPLE(a,b,c) (((unsigned)a)+((unsigned)b)*12582917U+((unsigned)c)*4256249U)
|
||||||
|
|
||||||
|
|
||||||
/* Inspection of BDD nodes */
|
/* Inspection of BDD nodes */
|
||||||
#define ISCONST(a) ((a) < 2)
|
#define ISCONST(a) ((a) < 2)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue