Struct pleco::tools::tt::TranspositionTable [−][src]
pub struct TranspositionTable { /* fields omitted */ }
Structure for representing a TranspositionTable
. A Transposition Table is a type
of HashTable that maps Zobrist Keys to information about that position, including the best move
found, score, depth the move was found at, and other information.
Methods
impl TranspositionTable
[src]
impl TranspositionTable
pub const MAX_SIZE_MB: usize
MAX_SIZE_MB: usize = 100000
pub fn new(mb_size: usize) -> Self
[src]
pub fn new(mb_size: usize) -> Self
Creates new with a size of around 'mb_size'. Actual size is the nearest power of 2 times the size of a Cluster rounded down.
Panics
mb_size should be > 0, or else a panic will occur
pub fn new_num_entries(num_entries: usize) -> Self
[src]
pub fn new_num_entries(num_entries: usize) -> Self
Creates new TT rounded up to the nearest power of two number of entries.
Panics
num_entries should be > 0, or else a panic will occur
pub fn new_num_clusters(num_clusters: usize) -> Self
[src]
pub fn new_num_clusters(num_clusters: usize) -> Self
Creates new TT rounded up to the nearest power of two number of Clusters.
Panics
Size should be > 0, or else a panic will occur
pub unsafe fn uninitialized_init(&self, mb_size: usize)
[src]
pub unsafe fn uninitialized_init(&self, mb_size: usize)
pub fn size_kilobytes(&self) -> usize
[src]
pub fn size_kilobytes(&self) -> usize
Returns the size of the heap allocated portion of the TT in KiloBytes.
pub fn size_megabytes(&self) -> usize
[src]
pub fn size_megabytes(&self) -> usize
Returns the size of the heap allocated portion of the TT in MegaBytes.
pub fn size_gigabytes(&self) -> usize
[src]
pub fn size_gigabytes(&self) -> usize
Returns the size of the heap allocated portion of the TT in GigaBytes.
pub fn num_clusters(&self) -> usize
[src]
pub fn num_clusters(&self) -> usize
Returns the number of clusters the Transposition Table holds.
pub fn num_entries(&self) -> usize
[src]
pub fn num_entries(&self) -> usize
Returns the number of Entries the Transposition Table holds.
pub unsafe fn resize_round_up(&self, size: usize)
[src]
pub unsafe fn resize_round_up(&self, size: usize)
Re-sizes to 'size' number of Clusters and deletes all data
Panic
size must be greater then 0
Safety
This is function is unsafe to use if the TT is currently being accessed, Or any thread of
structure contains a current reference to a TTEntry
. Otherwise, using this function will
absolutely lead to Segmentation Fault.
pub unsafe fn resize_to_megabytes(&self, mb_size: usize) -> usize
[src]
pub unsafe fn resize_to_megabytes(&self, mb_size: usize) -> usize
Re-sizes to the the mb_size number of megabytes, rounded down for power of 2 number of clusters. Returns the actual size.
Panic
mb_size must be greater then 0
Safety
This is function is unsafe to use if the TT is currently being accessed, Or any thread of
structure contains a current reference to a TTEntry
. Otherwise, using this function will
absolutely lead to Segmentation Fault.
pub unsafe fn clear(&self)
[src]
pub unsafe fn clear(&self)
Clears the entire TranspositionTable
Safety
This is function is unsafe to use if the TT is currently being accessed, Or any thread of
structure contains a current reference to a TTEntry
. Otherwise, using this function will
absolutely lead to Segmentation Fault.
pub fn new_search(&self)
[src]
pub fn new_search(&self)
pub fn time_age(&self) -> u8
[src]
pub fn time_age(&self) -> u8
Returns the current time age of a TT.
pub fn time_age_cylces(&self) -> u8
[src]
pub fn time_age_cylces(&self) -> u8
Returns the current number of cycles a TT has gone through. Cycles is simply the number of times refresh has been called.
pub fn probe(&self, key: Key) -> (bool, &mut Entry)
[src]
pub fn probe(&self, key: Key) -> (bool, &mut Entry)
Probes the Transposition Table for a specified Key. Returns (true, entry) if either (1) an
Entry corresponding to the current key is found, or an Open Entry slot is found for the key.
In the case of an open Entry, the entry can be tested for its contents by using Entry::is_empty()
.
If no entry is found && there are no open entries, returns the entry that is is most irrelevent to
the current search, e.g. has the shallowest depth or was found in a previous search.
If 'true' is returned, the Entry is guaranteed to have the correct time.
pub fn hash_percent(&self) -> f64
[src]
pub fn hash_percent(&self) -> f64
Returns the % of the hash table that is full.
Trait Implementations
impl Sync for TranspositionTable
[src]
impl Sync for TranspositionTable
impl PreFetchable for TranspositionTable
[src]
impl PreFetchable for TranspositionTable
fn prefetch(&self, key: u64)
[src]
fn prefetch(&self, key: u64)
Pre-fetches a particular key. This means bringing it into the cache for faster eventual access.
fn prefetch2(&self, key: u64)
[src]
fn prefetch2(&self, key: u64)
Pre-fetches a particular key, alongside the next key.
impl Drop for TranspositionTable
[src]
impl Drop for TranspositionTable
Auto Trait Implementations
impl !Send for TranspositionTable
impl !Send for TranspositionTable