My Project
pathEncoding.cc
Go to the documentation of this file.
1 /* pathEncoding.cc
2  */
3 #include "osl/pathEncoding.h"
4 #include "osl/random.h"
5 #include "osl/oslConfig.h"
6 #include <iostream>
7 
9 
10 namespace
11 {
12  namespace PathEncoding {
14  }
15 }
16 
18 init()
19 {
20  for (size_t i=0; i<MaxEncodingLength; ++i)
21  {
22  for (size_t j=0; j<Square::SIZE; ++j)
23  {
24  for (int k=0; k<PTYPE_SIZE; ++k)
25  {
26  const unsigned long long h = random();
27  const unsigned int l = random();
28  assert(l);
29  assert(h << 32);
30  // 手番を表現するため下位1bitをあけておく
31  values[i][j][k] = (h << 32) + (l & (~1u));
32  }
33  }
34  }
35 }
36 
37 #if (!defined MINIMAL ) || (defined DFPNSTATONE)
38 std::ostream& osl::operator<<(std::ostream& os, const osl::PathEncoding& path)
39 {
40  os << std::hex << path.getPath() << std::dec << " " << path.getDepth();
41  return os;
42 }
43 #endif
44 /* ------------------------------------------------------------------------- */
45 // ;;; Local Variables:
46 // ;;; mode:c++
47 // ;;; c-basic-offset:2
48 // ;;; End:
static osl::SetUpRegister _initializer([](){ osl::Centering3x3::table.init();})
static const size_t MaxEncodingLength
Definition: pathEncoding.h:14
unsigned long long getPath() const
Definition: pathEncoding.h:69
int getDepth() const
Definition: pathEncoding.h:70
unsigned int random()
Definition: random.cc:4
const int PTYPE_SIZE
Definition: basic_type.h:107
PathEncodingTable Path_Encoding_Table
Definition: pathEncoding.cc:8
std::ostream & operator<<(std::ostream &os, Player player)
Definition: basic_type.cc:14