Subversion Repositories Games.Chess Giants

Rev

Rev 96 | Rev 169 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 96 Rev 154
Line 90... Line 90...
90
  for (int i = 1; i < ClusterSize; ++i)
90
  for (int i = 1; i < ClusterSize; ++i)
91
      // Due to our packed storage format for generation and its cyclic
91
      // Due to our packed storage format for generation and its cyclic
92
      // nature we add 259 (256 is the modulus plus 3 to keep the lowest
92
      // nature we add 259 (256 is the modulus plus 3 to keep the lowest
93
      // two bound bits from affecting the result) to calculate the entry
93
      // two bound bits from affecting the result) to calculate the entry
94
      // age correctly even after generation8 overflows into the next cycle.
94
      // age correctly even after generation8 overflows into the next cycle.
95
      if (  replace->depth8 - ((259 + generation8 - replace->genBound8) & 0xFC) * 2 * ONE_PLY
95
      if (  replace->depth8 - ((259 + generation8 - replace->genBound8) & 0xFC) * 2
96
          >   tte[i].depth8 - ((259 + generation8 -   tte[i].genBound8) & 0xFC) * 2 * ONE_PLY)
96
          >   tte[i].depth8 - ((259 + generation8 -   tte[i].genBound8) & 0xFC) * 2)
97
          replace = &tte[i];
97
          replace = &tte[i];
98
 
98
 
99
  return found = false, replace;
99
  return found = false, replace;
100
}
100
}
101
 
101
 
102
 
102
 
103
/// Returns an approximation of the hashtable occupation during a search. The
103
/// TranspositionTable::hashfull() returns an approximation of the hashtable
104
/// hash is x permill full, as per UCI protocol.
104
/// occupation during a search. The hash is x permill full, as per UCI protocol.
-
 
105
 
-
 
106
int TranspositionTable::hashfull() const {
105
 
107
 
106
int TranspositionTable::hashfull() const
-
 
107
{
-
 
108
  int cnt = 0;
108
  int cnt = 0;
109
  for (int i = 0; i < 1000 / ClusterSize; i++)
109
  for (int i = 0; i < 1000 / ClusterSize; i++)
110
  {
110
  {
111
      const TTEntry* tte = &table[i].entry[0];
111
      const TTEntry* tte = &table[i].entry[0];
112
      for (int j = 0; j < ClusterSize; j++)
112
      for (int j = 0; j < ClusterSize; j++)