This is the doxygen documentation for gtkboard.
.
Main Page Data Structures File List Data Fields Globals
hash.c File Reference
hash table which implements transposition tables.
More...
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>
#include <glib.h>
#include "move.h"
Go to the source code of this file.
Data Structures |
struct | hash_t |
Defines |
#define | uint unsigned |
#define | byte gint8 |
Functions |
void | hash_init () |
uint | get_hash (byte *pos, int poslen) |
uint | get_check (byte *pos, int poslen) |
void | hash_insert (byte *pos, int poslen, int num_moves, int depth, float eval, byte *move) |
int | hash_get_eval (byte *pos, int poslen, int num_moves, int depth, float *evalp) |
byte* | hash_get_move (byte *pos, int poslen, int num_moves) |
void | hash_clear () |
void | hash_print_stats () |
Variables |
int | opt_verbose |
int | hash_table_size = 1 << 16 |
int | hash_table_max = 3 * 1 << 14 |
int | num_hash_coeffts = 1024 |
uint* | hash_coeffts = NULL |
hash_t* | hash_table = NULL |
int | hash_filled = 0 |
int | hash_eval_hits = 0 |
int | hash_eval_misses = 0 |
int | hash_move_hits = 0 |
int | hash_move_misses = 0 |
Detailed Description
hash table which implements transposition tables.
A hash entry stores the following information: value of the node depth to which it has been explored verification code (secondary hash value)
if there is a collision and the table is less than (say) 75% full, search sequentially till an empty cell is found otherwise just kick out the previous entry (if depth of the current entry is smaller than the earlier entry, search sequentially till a shallower node is found and kick it out)
When used with DFID, if l levels were completed on the previous move, l-2 levels (ply) will be completed almost instantly on this move. Even if we are unable to complete level l on this move, it mattereth not, for the partial information will be there in the hash table and will be useful for the next move.
Definition in file hash.c.
Define Documentation
Function Documentation
uint get_check (
|
byte * pos,
|
|
int poslen ) [static]
|
|
uint get_hash (
|
byte * pos,
|
|
int poslen ) [static]
|
|
int hash_get_eval (
|
byte * pos,
|
|
int poslen,
|
|
int num_moves,
|
|
int depth,
|
|
float * evalp )
|
|
byte* hash_get_move (
|
byte * pos,
|
|
int poslen,
|
|
int num_moves )
|
|
void hash_init (
|
) [static]
|
|
void hash_insert (
|
byte * pos,
|
|
int poslen,
|
|
int num_moves,
|
|
int depth,
|
|
float eval,
|
|
byte * move )
|
|
void hash_print_stats (
|
)
|
|
Variable Documentation
uint* hash_coeffts = NULL [static]
|
|
int hash_eval_hits = 0 [static]
|
|
int hash_eval_misses = 0 [static]
|
|
int hash_filled = 0 [static]
|
|
int hash_move_hits = 0 [static]
|
|
int hash_move_misses = 0 [static]
|
|
hash_t* hash_table = NULL [static]
|
|
int hash_table_max = 3 * 1 << 14 [static]
|
|
int hash_table_size = 1 << 16 [static]
|
|
int num_hash_coeffts = 1024 [static]
|
|