All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pathEncoding.cc
Go to the documentation of this file.
1 /* pathEncoding.cc
2  */
3 #include "osl/misc/random.h"
4 #include "osl/pathEncoding.h"
5 #include <iostream>
6 
9 {
10  for (size_t i=0; i<MaxEncodingLength; ++i)
11  {
12  for (size_t j=0; j<Square::SIZE; ++j)
13  {
14  for (int k=0; k<PTYPE_SIZE; ++k)
15  {
16  const unsigned long long h = random();
17  const unsigned int l = random();
18  assert(l);
19  assert(h << 32);
20  // 手番を表現するため下位1bitをあけておく
21  values[i][j][k] = (h << 32) + (l & (~1u));
22  }
23  }
24  }
25 }
26 
29 {
30 }
31 
32 #if (!defined MINIMAL ) || (defined DFPNSTATONE)
33 std::ostream& osl::operator<<(std::ostream& os, const osl::PathEncoding& path)
34 {
35  os << std::hex << path.getPath() << std::dec << " " << path.getDepth();
36  return os;
37 }
38 #endif
39 /* ------------------------------------------------------------------------- */
40 // ;;; Local Variables:
41 // ;;; mode:c++
42 // ;;; c-basic-offset:2
43 // ;;; End: