6 #include <unordered_map>
11 typedef std::unordered_map<osl::HashKey,list_t,std::hash<osl::HashKey>>
map_t;
42 : continuous_check(c.continuous_check),
43 hash_history(c.hash_history)
71 continuous_check[last_turn].push_back(checkCount(last_turn)+1);
75 continuous_check[last_turn].push_back(0);
78 const Table::iterator p=table->find(new_key);
79 if (p == table->end())
81 (*table)[new_key].push_front(order());
86 l.push_front(order());
88 hash_history.push(new_key);
94 const bool is_check = state.
inCheck();
123 assert(hash_history.size()>0);
124 const HashKey last_key = hash_history.top();
128 assert(! continuous_check[last_turn].empty());
129 continuous_check[last_turn].pop_back();
131 const Table::iterator p=table->find(last_key);
132 assert(p != table->end());
135 const list_t::iterator q = p->second.begin();
136 assert(q != p->second.end());
137 assert(*q == order());
139 p->second.pop_front();
140 if (p->second.empty())
147 const Table::const_iterator p=table->find(key);
148 if (p == table->end())
150 return p->second.front();
155 const Table::const_iterator p=table->find(key);
156 if (p == table->end())
158 list_t::const_iterator q = p->second.begin();
159 assert(q != p->second.end());
161 while (q != p->second.end())
171 const Table::const_iterator p=table->find(key);
172 if (p == table->end())
176 if (p->second.size() < 3)
178 return isAlmostSennichite(key);
184 const Table::const_iterator p=table->find(key);
185 if (p == table->end())
187 return std::make_pair(isAlmostSennichite(key), p->second.size());
193 const Table::const_iterator p=table->find(key);
194 if (p == table->end())
196 return p->second.size();
202 Table::const_iterator p=table->find(key);
203 if (p == table->end())
212 Table::const_iterator p=table->find(key);
213 if (p == table->end())
215 for (
int q: p->second) {
216 std::cerr << q <<
" ";
225 Table table(*this->table);
227 while (history.
empty())
233 assert(! continuous_check[last_turn].empty());
234 continuous_check[last_turn].pop_back();
236 const Table::iterator p=table.find(last_key);
237 if (p == table.end())
239 std::cerr <<
"oops, " <<
this <<
"\n";
242 assert(p != table.end());
245 const list_t::iterator q = p->second.begin();
246 assert(q != p->second.end());
247 assert(*q == order());
249 p->second.pop_front();
250 if (p->second.empty())
258 #if ! (__GNUC__ >= 4 && __GNUC_MINOR__ >=3)