Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
osl::checkmate::DfpnTable Class Reference

詰探索局面表 – 並列でも共有する部分 More...

#include <dfpn.h>

Classes

struct  List
 
struct  Table
 

Public Member Functions

 DfpnTable (Player attack)
 
 DfpnTable ()
 
 ~DfpnTable ()
 
template<Player Attack>
const DfpnRecord probe (const HashKey &key, PieceStand white) const
 
const DfpnRecord probe (const HashKey &key, PieceStand white) const
 
size_t estimateNodeCount (const HashKey &key, bool dominance_max=false) const
 
template<Player Attack>
const DfpnRecord findProofOracle (const HashKey &key, PieceStand white, Move last_move=Move()) const
 
const DfpnRecord findProofOracle (const HashKey &key, PieceStand white, Move last_move=Move()) const
 
template<Player Attack>
void showProofOracles (const HashKey &key, PieceStand white, Move last_move=Move()) const
 
size_t size () const
 
void showStats () const
 
void setAttack (Player)
 
void setWorking (const HashKey &key, const DfpnRecord &value, int thread_id)
 
void leaveWorking (const HashKey &key, int thread_id)
 
void store (const HashKey &key, DfpnRecord &value, int leaving_thread_id=-1)
 
void addDag (const HashKey &key, DfpnRecord &value)
 
void clear ()
 
size_t totalSize ()
 
Player attack () const
 
void setMaxDepth (int)
 
int maxDepth () const
 
void testTable ()
 
size_t smallTreeGC (size_t threshold=10)
 
void setGrowthLimit (size_t new_limit)
 set the maximum size of table (otherwise infinity). More...
 
size_t growthLimit () const
 
bool runGC ()
 
template<osl::Player Attack>
osl::checkmate::DfpnTable::Listfind (const HashKey &key, int subindex)
 
template<osl::Player Attack>
const osl::checkmate::DfpnTable::Listfind (const HashKey &key, int subindex) const
 
template<osl::Player Attack>
const osl::checkmate::DfpnRecord probe (const HashKey &key, PieceStand white_stand) const
 
template<osl::Player Attack>
const osl::checkmate::DfpnRecord findProofOracle (const HashKey &key, PieceStand white_stand, Move last_move) const
 

Private Member Functions

template<Player Attack>
Listfind (const HashKey &key, int subindex)
 
template<Player Attack>
const Listfind (const HashKey &key, int subindex) const
 
const Listfind (const HashKey &key, int subindex) const
 

Static Private Member Functions

static int keyToIndex (const HashKey &key)
 

Private Attributes

boost::scoped_array< Tabletable
 
size_t total_size
 
int dfpn_max_depth
 
size_t growth_limit
 
size_t gc_threshold
 

Static Private Attributes

static const int DIVSIZE =1
 

Detailed Description

詰探索局面表 – 並列でも共有する部分

Definition at line 29 of file dfpn.h.

Constructor & Destructor Documentation

§ DfpnTable() [1/2]

osl::checkmate::DfpnTable::DfpnTable ( Player  attack)

Definition at line 893 of file dfpn.cc.

References DfpnTable(), and setAttack().

§ DfpnTable() [2/2]

osl::checkmate::DfpnTable::DfpnTable ( )

Definition at line 902 of file dfpn.cc.

References ~DfpnTable().

Referenced by DfpnTable(), and osl::checkmate::DfpnTable::Table::Table().

§ ~DfpnTable()

osl::checkmate::DfpnTable::~DfpnTable ( )

Definition at line 907 of file dfpn.cc.

References setGrowthLimit().

Referenced by DfpnTable().

Member Function Documentation

§ addDag()

void osl::checkmate::DfpnTable::addDag ( const HashKey key,
DfpnRecord value 
)

§ attack()

osl::Player osl::checkmate::DfpnTable::attack ( ) const

§ clear()

void osl::checkmate::DfpnTable::clear ( )

Definition at line 1157 of file dfpn.cc.

References DIVSIZE, SCOPED_LOCK, table, testTable(), and total_size.

Referenced by osl::checkmate::Dfpn::currentTable(), and leaveWorking().

§ estimateNodeCount()

size_t osl::checkmate::DfpnTable::estimateNodeCount ( const HashKey key,
bool  dominance_max = false 
) const

§ find() [1/5]

template<Player Attack>
List* osl::checkmate::DfpnTable::find ( const HashKey key,
int  subindex 
)
private

§ find() [2/5]

template<Player Attack>
const List* osl::checkmate::DfpnTable::find ( const HashKey key,
int  subindex 
) const
private

§ find() [3/5]

const osl::checkmate::DfpnTable::List * osl::checkmate::DfpnTable::find ( const HashKey key,
int  subindex 
) const
private

Definition at line 985 of file dfpn.cc.

References osl::hash::HashKey128::boardKey(), find(), probe(), and table.

§ find() [4/5]

template<osl::Player Attack>
osl::checkmate::DfpnTable::List* osl::checkmate::DfpnTable::find ( const HashKey key,
int  subindex 
)

Definition at line 958 of file dfpn.cc.

References attack(), osl::hash::HashKey128::boardKey(), find(), and table.

§ find() [5/5]

template<osl::Player Attack>
const osl::checkmate::DfpnTable::List* osl::checkmate::DfpnTable::find ( const HashKey key,
int  subindex 
) const

Definition at line 977 of file dfpn.cc.

References attack(), find(), and table.

§ findProofOracle() [1/3]

template<Player Attack>
const DfpnRecord osl::checkmate::DfpnTable::findProofOracle ( const HashKey key,
PieceStand  white,
Move  last_move = Move() 
) const

§ findProofOracle() [2/3]

const osl::checkmate::DfpnRecord osl::checkmate::DfpnTable::findProofOracle ( const HashKey key,
PieceStand  white,
Move  last_move = Move() 
) const

Definition at line 1036 of file dfpn.cc.

References attack(), osl::BLACK, showProofOracles(), and table.

§ findProofOracle() [3/3]

template<osl::Player Attack>
const osl::checkmate::DfpnRecord osl::checkmate::DfpnTable::findProofOracle ( const HashKey key,
PieceStand  white_stand,
Move  last_move 
) const

§ growthLimit()

size_t osl::checkmate::DfpnTable::growthLimit ( ) const
inline

Definition at line 73 of file dfpn.h.

References DIVSIZE, growth_limit, and runGC().

Referenced by osl::checkmate::Dfpn::attack(), and osl::checkmate::Dfpn::setTable().

§ keyToIndex()

static int osl::checkmate::DfpnTable::keyToIndex ( const HashKey key)
inlinestaticprivate

§ leaveWorking()

void osl::checkmate::DfpnTable::leaveWorking ( const HashKey key,
int  thread_id 
)

§ maxDepth()

int osl::checkmate::DfpnTable::maxDepth ( ) const

§ probe() [1/3]

template<Player Attack>
const DfpnRecord osl::checkmate::DfpnTable::probe ( const HashKey key,
PieceStand  white 
) const

§ probe() [2/3]

const osl::checkmate::DfpnRecord osl::checkmate::DfpnTable::probe ( const HashKey key,
PieceStand  white 
) const

Definition at line 1015 of file dfpn.cc.

References attack(), osl::BLACK, findProofOracle(), and table.

§ probe() [3/3]

template<osl::Player Attack>
const osl::checkmate::DfpnRecord osl::checkmate::DfpnTable::probe ( const HashKey key,
PieceStand  white_stand 
) const

Definition at line 1002 of file dfpn.cc.

References keyToIndex(), probe(), osl::checkmate::DfpnTable::List::probe(), and SCOPED_LOCK.

§ runGC()

bool osl::checkmate::DfpnTable::runGC ( )

§ setAttack()

void osl::checkmate::DfpnTable::setAttack ( Player  a)

Definition at line 942 of file dfpn.cc.

References attack(), DIVSIZE, size(), and table.

Referenced by DfpnTable(), and maxDepth().

§ setGrowthLimit()

void osl::checkmate::DfpnTable::setGrowthLimit ( size_t  new_limit)

set the maximum size of table (otherwise infinity).

this is one of preconditions to enable GC inside dfpn.

Definition at line 912 of file dfpn.cc.

References DIVSIZE, growth_limit, showStats(), and table.

Referenced by totalSize(), and ~DfpnTable().

§ setMaxDepth()

void osl::checkmate::DfpnTable::setMaxDepth ( int  new_depth)

Definition at line 931 of file dfpn.cc.

References dfpn_max_depth, and maxDepth().

Referenced by osl::checkmate::Dfpn::setTable(), showStats(), and totalSize().

§ setWorking()

void osl::checkmate::DfpnTable::setWorking ( const HashKey key,
const DfpnRecord value,
int  thread_id 
)

§ showProofOracles()

template<osl::Player Attack>
void osl::checkmate::DfpnTable::showProofOracles ( const HashKey key,
PieceStand  white,
Move  last_move = Move() 
) const

§ showStats()

void osl::checkmate::DfpnTable::showStats ( ) const

Definition at line 921 of file dfpn.cc.

References DIVSIZE, setMaxDepth(), size(), table, and total_size.

Referenced by setGrowthLimit().

§ size()

size_t osl::checkmate::DfpnTable::size ( ) const

Definition at line 1251 of file dfpn.cc.

References total_size.

Referenced by osl::checkmate::Dfpn::Tree::dump(), runGC(), setAttack(), and showStats().

§ smallTreeGC()

size_t osl::checkmate::DfpnTable::smallTreeGC ( size_t  threshold = 10)

Definition at line 1191 of file dfpn.cc.

References DIVSIZE, runGC(), SCOPED_LOCK, table, and total_size.

Referenced by runGC(), testTable(), and totalSize().

§ store()

void osl::checkmate::DfpnTable::store ( const HashKey key,
DfpnRecord value,
int  leaving_thread_id = -1 
)

§ testTable()

void osl::checkmate::DfpnTable::testTable ( )

Definition at line 1169 of file dfpn.cc.

References DIVSIZE, SCOPED_LOCK, smallTreeGC(), and table.

Referenced by clear(), and totalSize().

§ totalSize()

size_t osl::checkmate::DfpnTable::totalSize ( )
inline

Member Data Documentation

§ dfpn_max_depth

int osl::checkmate::DfpnTable::dfpn_max_depth
private

Definition at line 35 of file dfpn.h.

Referenced by maxDepth(), and setMaxDepth().

§ DIVSIZE

const int osl::checkmate::DfpnTable::DIVSIZE =1
staticprivate

§ gc_threshold

size_t osl::checkmate::DfpnTable::gc_threshold
private

Definition at line 36 of file dfpn.h.

Referenced by runGC().

§ growth_limit

size_t osl::checkmate::DfpnTable::growth_limit
private

Definition at line 36 of file dfpn.h.

Referenced by growthLimit(), runGC(), and setGrowthLimit().

§ table

boost::scoped_array<Table> osl::checkmate::DfpnTable::table
private

§ total_size

size_t osl::checkmate::DfpnTable::total_size
private

Definition at line 34 of file dfpn.h.

Referenced by clear(), runGC(), setWorking(), showStats(), size(), smallTreeGC(), store(), and totalSize().


The documentation for this class was generated from the following files: