summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bbdf9e4)
We send to GUI multi-pv info after each cycle,
not just once at the end of the PV loop. This is
because at high depths a single root search can
be very slow and we want to update the gui as
soon as we have a new PV score.
Idea is good but implementation is broken because
sort() takes as arguments a pointer to the first
element and one past the last element.
So fix the bug and rename sort arguments to better
reflect their meaning.
Another hit by Hongzhi Cheng. Impressive!
No functional change.
}
// Sort the PV lines searched so far and update the GUI
}
// Sort the PV lines searched so far and update the GUI
- sort<RootMove>(RootMoves.begin(), RootMoves.begin() + PVIdx);
+ sort<RootMove>(RootMoves.begin(), RootMoves.begin() + PVIdx + 1);
sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
}
sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
}
/// Our insertion sort implementation, works with pointers and iterators and is
/// guaranteed to be stable, as is needed.
template<typename T, typename K>
/// Our insertion sort implementation, works with pointers and iterators and is
/// guaranteed to be stable, as is needed.
template<typename T, typename K>
-void sort(K first, K last)
+void sort(K begin, K end)
- for (p = first + 1; p < last; p++)
+ for (p = begin + 1; p < end; p++)
- for (q = p; q != first && *(q-1) < tmp; --q)
+ for (q = p; q != begin && *(q-1) < tmp; --q)