BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
chess::moves::PerftResult Struct Referencefinal

#include <libchess/moves/Perft.hpp>

Collaboration diagram for chess::moves::PerftResult:

Public Types

using RootNodeInfo = std::pair<moves::Move, size_t>

Public Member Functions

constexpr auto operator+= (const PerftResult &rhs) noexcept -> PerftResult &

Public Attributes

size_t captures { 0uz }
size_t castles { 0uz }
size_t checkmates { 0uz }
size_t checks { 0uz }
size_t enPassantCaptures { 0uz }
size_t nodes { 0uz }
size_t promotions { 0uz }
std::vector< RootNodeInforootNodes
size_t stalemates { 0uz }

(Note that these are not member symbols.)

template<bool IsRoot = true>
auto perft (size_t depth, const game::Position &startingPosition) -> PerftResult

Detailed Description

Results from a perft computation.

See also
perft()

Definition at line 38 of file Perft.hpp.

Member Typedef Documentation

◆ RootNodeInfo

A pair of a move and its number of child nodes.

Definition at line 64 of file Perft.hpp.

Member Function Documentation

◆ operator+=()

auto chess::moves::PerftResult::operator+= ( const PerftResult & rhs) -> PerftResult &
constexprnoexcept

Adds a child result to this one.

Definition at line 104 of file Perft.hpp.

Member Data Documentation

◆ captures

size_t chess::moves::PerftResult::captures { 0uz }

The number of leaf nodes that are captures.

Definition at line 43 of file Perft.hpp.

◆ castles

size_t chess::moves::PerftResult::castles { 0uz }

The number of leaf nodes that are castling.

Definition at line 49 of file Perft.hpp.

◆ checkmates

size_t chess::moves::PerftResult::checkmates { 0uz }

The number of leaf nodes that are checkmates.

Definition at line 58 of file Perft.hpp.

◆ checks

size_t chess::moves::PerftResult::checks { 0uz }

The number of leaf nodes that are checks.

Definition at line 55 of file Perft.hpp.

◆ enPassantCaptures

size_t chess::moves::PerftResult::enPassantCaptures { 0uz }

The number of leaf nodes that are en passant captures.

Definition at line 46 of file Perft.hpp.

◆ nodes

size_t chess::moves::PerftResult::nodes { 0uz }

The total number of nodes in the move tree.

Definition at line 40 of file Perft.hpp.

◆ promotions

size_t chess::moves::PerftResult::promotions { 0uz }

The number of leaf nodes that are promotions.

Definition at line 52 of file Perft.hpp.

◆ rootNodes

std::vector<RootNodeInfo> chess::moves::PerftResult::rootNodes

For each of the root moves from the starting position, this records how many child nodes are under that move's branch of the tree.

Definition at line 70 of file Perft.hpp.

◆ stalemates

size_t chess::moves::PerftResult::stalemates { 0uz }

The number of leaf nodes that are stalemates.

Definition at line 61 of file Perft.hpp.


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