BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
ben_bot::SearchStack Struct Referencefinal

#include <libbenbot/data-structures/SearchStack.hpp>

Public Member Functions

auto at (const size_t plyFromRoot) const noexcept -> const SearchStackEntry *
auto at (const size_t plyFromRoot) noexcept -> SearchStackEntry *

Static Public Attributes

static constexpr auto SENTINELS { 4uz }

(Note that these are not member symbols.)

auto is_improving (const SearchStackEntry *const entry) noexcept -> bool

Detailed Description

This structure stores information about each node on the current search path, indexed by ply from the root of the search (the root is ply 0).

There are SENTINELS entries before the root's entry, which always hold a null move and no static eval, so a node can always look at least that many plies back without checking how far it is from the root.

Each node's entry is reset by its parent right before the node is searched, so an entry never holds anything left over from an unrelated node that was searched earlier at the same ply.

Definition at line 70 of file SearchStack.hpp.

Member Function Documentation

◆ at() [1/2]

auto ben_bot::SearchStack::at ( const size_t plyFromRoot) const -> const SearchStackEntry *
inlinenodiscardnoexcept

Returns the entry for the node at the given ply from the root.

Definition at line 86 of file SearchStack.hpp.

◆ at() [2/2]

auto ben_bot::SearchStack::at ( const size_t plyFromRoot) -> SearchStackEntry *
inlinenodiscardnoexcept

Returns the entry for the node at the given ply from the root. The entries before it, down to SENTINELS plies before the root, can be reached with std::prev().

Definition at line 78 of file SearchStack.hpp.

Member Data Documentation

◆ SENTINELS

auto ben_bot::SearchStack::SENTINELS { 4uz }
staticconstexpr

The number of sentinel entries before the root's entry.

Definition at line 72 of file SearchStack.hpp.


The documentation for this struct was generated from the following file: