All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
dfpnRecord.h
Go to the documentation of this file.
1 /* dfpnRecord.h
2  */
3 #ifndef OSL_DFPNRECORD_H
4 #define OSL_DFPNRECORD_H
5 
7 #include "osl/move.h"
8 #include "osl/pieceStand.h"
9 
10 #define NAGAI_DAG_TEST
11 
12 namespace osl
13 {
14  namespace checkmate
15  {
17  {
20  uint64_t solved;
21 #ifdef NAGAI_DAG_TEST
22 
23  uint64_t dag_moves;
24 #endif
27  mutable unsigned int node_count;
28  unsigned int tried_oracle;
33  unsigned int min_pdp; // solved のmin
34  uint32_t working_threads;
39 #ifdef NAGAI_DAG_TEST
41 #endif
42 
44  : solved(0),
45 #ifdef NAGAI_DAG_TEST
46  dag_moves(0),
47 #endif
48  node_count(0), tried_oracle(0), min_pdp(ProofDisproof::PROOF_MAX),
49  working_threads(0),
51 #ifdef NAGAI_DAG_TEST
52  , dag_terminal(0)
53 #endif
54  {
55  }
56  };
57 
58  class DfpnRecord : public DfpnRecordBase
59  {
60  public:
61  CArray<PieceStand,2> stands;
62 
64  DfpnRecord(PieceStand black, PieceStand white) { stands[BLACK] = black; stands[WHITE] = white; }
65 
66  void setFrom(const DfpnRecordBase& src)
67  {
68  static_cast<DfpnRecordBase*>(this)->operator=(src);
69  node_count = 1;
70  solved = 0;
71  last_to = Square();
72  last_move = Move();
73  need_full_width = false_branch = false;
74 #ifdef NAGAI_DAG_TEST
75  dag_moves = 0;
76  dag_terminal = false;
77 #endif
78  }
79  unsigned int proof() const { return proof_disproof.proof(); }
80  unsigned int disproof() const { return proof_disproof.disproof(); }
82  {
83  assert(proof_pieces_set == UNSET);
84  assert((stands[BLACK] == PieceStand() && stands[WHITE] == PieceStand())
85  || stands[BLACK].isSuperiorOrEqualTo(a)
86  || stands[WHITE].isSuperiorOrEqualTo(a));
88  proof_pieces = a;
89  }
91  {
92  assert(proof_pieces_set == UNSET);
93  assert((stands[BLACK] == PieceStand() && stands[WHITE] == PieceStand())
94  || stands[BLACK].isSuperiorOrEqualTo(a)
95  || stands[WHITE].isSuperiorOrEqualTo(a));
97  proof_pieces = a;
98  }
99  const PieceStand proofPieces() const
100  {
101  assert(proof_pieces_set == PROOF);
102  return proof_pieces;
103  }
104  const PieceStand disproofPieces() const
105  {
106  assert(proof_pieces_set == DISPROOF);
107  return proof_pieces;
108  }
109  };
110  }
111 }
112 
113 
114 
115 #endif /* OSL_DFPNRECORD_H */
116 // ;;; Local Variables:
117 // ;;; mode:c++
118 // ;;; c-basic-offset:2
119 // ;;; End: