Content deleted Content added
→History: enhance ref |
→Direct hashing: add refs |
||
Line 64:
==== Direct hashing ====
The rank and file attack vectors of rooks and the diagonal and anti-diagonal attack vectors of bishops can be separately masked and used as indices into a hash table of precomputed attack vectors depending on occupancy, 8-bits each for rooks and 2-8 bits each for bishops. The full attack vector of a piece is obtained as the union of each of the two unidirectional vectors indexed from the hash table. The number of entries in the hash table is modest, on the order of 8*2^8 or 2K bytes, but two hash function computations and two lookups per piece are required.<ref>Tannous, S. 2006, Avoiding Rotated Bitboards with Direct Lookup ICGA journal 30(2) May 2007 </ref> For the hashing scheme employed, see <ref>Knuth, Donald, 1973, The Art of Computer Programming Vol. 3, sec. 6.4, Algorithm D (Open addressing with double hashing)</ref>
==== Magic bitboards ====
|