pathEncoding.cc
Go to the documentation of this file.
00001 /* pathEncoding.cc
00002  */
00003 #include "osl/misc/random.h"
00004 #include "osl/pathEncoding.h"
00005 #include <iostream>
00006 
00007 osl::PathEncodingTable::
00008 PathEncodingTable()
00009 {
00010   for (size_t i=0; i<MaxEncodingLength; ++i)
00011   {
00012     for (size_t j=0; j<Square::SIZE; ++j)
00013     {
00014       for (int k=0; k<PTYPE_SIZE; ++k)
00015       {
00016         const unsigned long long h = random();
00017         const unsigned int l = random();
00018         assert(l);
00019         assert(h << 32);
00020         // 手番を表現するため下位1bitをあけておく
00021         values[i][j][k] = (h << 32) + (l & (~1u));
00022       }
00023     }
00024   }
00025 }
00026 
00027 osl::PathEncodingTable::
00028 ~PathEncodingTable()
00029 {
00030 }
00031 
00032 #if (!defined MINIMAL ) || (defined DFPNSTATONE)
00033 std::ostream& osl::operator<<(std::ostream& os, const osl::PathEncoding& path)
00034 {
00035   os << std::hex << path.getPath() << std::dec << " " << path.getDepth();
00036   return os;
00037 }
00038 #endif
00039 /* ------------------------------------------------------------------------- */
00040 // ;;; Local Variables:
00041 // ;;; mode:c++
00042 // ;;; c-basic-offset:2
00043 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines