[][src]Struct pleco::tools::tt::TranspositionTable

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]

pub const MAX_SIZE_MB: usize[src]

pub fn new(mb_size: usize) -> Self[src]

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]

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]

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 fn size_kilobytes(&self) -> usize[src]

Returns the size of the heap allocated portion of the TT in KiloBytes.

pub fn size_megabytes(&self) -> usize[src]

Returns the size of the heap allocated portion of the TT in MegaBytes.

pub fn size_gigabytes(&self) -> usize[src]

Returns the size of the heap allocated portion of the TT in GigaBytes.

pub fn num_clusters(&self) -> usize[src]

Returns the number of clusters the Transposition Table holds.

pub fn num_entries(&self) -> usize[src]

Returns the number of Entries the Transposition Table holds.

pub unsafe fn resize_round_up(&self, size: usize)[src]

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 a Segmentation Fault.

pub unsafe fn resize_to_megabytes(&self, mb_size: usize) -> usize[src]

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]

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 a Segmentation Fault.

pub fn time_age(&self) -> u8[src]

Returns the current time age of a TT.

pub fn time_age_cylces(&self) -> u8[src]

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]

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]

Returns the % of the hash table that is full.

Trait Implementations

impl PreFetchable for TranspositionTable[src]

fn prefetch(&self, key: u64)[src]

Pre-fetches a particular key. This means bringing it into the cache for faster eventual access.

fn prefetch2(&self, key: u64)[src]

Pre-fetches a particular key, alongside the next key.

impl Sync for TranspositionTable[src]

impl Drop for TranspositionTable[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.