]> git.sesse.net Git - stockfish/blobdiff - src/search.h
Update authors
[stockfish] / src / search.h
index 5a0ad5df5790708e3a0e1d8d37f2926fcb3b668a..c7abb9dcfd97a2b5b47b87f798fc4e5718cd2bb7 100644 (file)
@@ -47,6 +47,7 @@ struct Stack {
   Depth reduction;
   Value staticEval;
   bool skipEarlyPruning;
+  int moveCount;
 };
 
 /// RootMove struct is used for moves at the root of the tree. For each root move
@@ -55,15 +56,15 @@ struct Stack {
 
 struct RootMove {
 
-  RootMove(Move m) : score(-VALUE_INFINITE), previousScore(-VALUE_INFINITE), pv(1, m) {}
+  explicit RootMove(Move m) : pv(1, m) {}
 
   bool operator<(const RootMove& m) const { return score > m.score; } // Ascending sort
   bool operator==(const Move& m) const { return pv[0] == m; }
   void insert_pv_in_tt(Position& pos);
-  Move extract_ponder_from_tt(Position& pos);
+  bool extract_ponder_from_tt(Position& pos);
 
-  Value score;
-  Value previousScore;
+  Value score = -VALUE_INFINITE;
+  Value previousScore = -VALUE_INFINITE;
   std::vector<Move> pv;
 };
 
@@ -76,7 +77,7 @@ typedef std::vector<RootMove> RootMoveVector;
 struct LimitsType {
 
   LimitsType() { // Init explicitly due to broken value-initialization of non POD in MSVC
-    nodes = time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] = movestogo =
+    nodes = time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] = npmsec = movestogo =
     depth = movetime = mate = infinite = ponder = 0;
   }
 
@@ -85,8 +86,9 @@ struct LimitsType {
   }
 
   std::vector<Move> searchmoves;
-  int time[COLOR_NB], inc[COLOR_NB], movestogo, depth, movetime, mate, infinite, ponder;
+  int time[COLOR_NB], inc[COLOR_NB], npmsec, movestogo, depth, movetime, mate, infinite, ponder;
   int64_t nodes;
+  TimePoint startTime;
 };
 
 /// The SignalsType struct stores volatile flags updated during the search
@@ -96,17 +98,14 @@ struct SignalsType {
   bool stop, stopOnPonderhit, firstRootMove, failedLowAtRoot;
 };
 
-typedef std::auto_ptr<std::stack<StateInfo> > StateStackPtr;
+typedef std::unique_ptr<std::stack<StateInfo>> StateStackPtr;
 
 extern volatile SignalsType Signals;
 extern LimitsType Limits;
-extern RootMoveVector RootMoves;
-extern Position RootPos;
-extern Time::point SearchTime;
 extern StateStackPtr SetupStates;
 
 void init();
-void think();
+void reset();
 template<bool Root> uint64_t perft(Position& pos, Depth depth);
 
 } // namespace Search