}
else
{
- Threads.start_searching(pos, limits);
+ Threads.start_searching(pos, limits, vector<Move>());
Threads.wait_for_search_finished();
nodes += Search::RootPosition.nodes_searched();
}
std::string args;
for (int i = 1; i < argc; i++)
- args += std::string(" ") + argv[i];
+ args += std::string(argv[i]) + " ";
uci_loop(args);
}
// main_loop() so to start a new search, then returns immediately.
void ThreadsManager::start_searching(const Position& pos, const LimitsType& limits,
- const std::set<Move>& searchMoves) {
+ const std::vector<Move>& searchMoves) {
wait_for_search_finished();
SearchTime.restart(); // As early as possible
RootMoves.clear();
for (MoveList<MV_LEGAL> ml(pos); !ml.end(); ++ml)
- if (searchMoves.empty() || searchMoves.count(ml.move()))
+ if (searchMoves.empty() || count(searchMoves.begin(), searchMoves.end(), ml.move()))
RootMoves.push_back(RootMove(ml.move()));
threads[0]->do_sleep = false;
#if !defined(THREAD_H_INCLUDED)
#define THREAD_H_INCLUDED
-#include <set>
#include <vector>
#include "material.h"
void set_timer(int msec);
void wait_for_search_finished();
void start_searching(const Position& pos, const Search::LimitsType& limits,
- const std::set<Move>& = std::set<Move>());
+ const std::vector<Move>& searchMoves);
template <bool Fake>
Value split(Position& pos, Search::Stack* ss, Value alpha, Value beta, Value bestValue, Move* bestMove,
void go(Position& pos, istringstream& is) {
Search::LimitsType limits;
- std::set<Move> searchMoves;
+ vector<Move> searchMoves;
string token;
while (is >> token)
limits.ponder = true;
else if (token == "searchmoves")
while (is >> token)
- searchMoves.insert(move_from_uci(pos, token));
+ searchMoves.push_back(move_from_uci(pos, token));
}
Threads.start_searching(pos, limits, searchMoves);
int e = time.elapsed();
- std::cout << "\nNodes " << n
- << "\nTime (ms) " << e
- << "\nNodes/second " << int(n / (e / 1000.0)) << std::endl;
+ cout << "\nNodes " << n
+ << "\nTime (ms) " << e
+ << "\nNodes/second " << int(n / (e / 1000.0)) << endl;
}
}