mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 11:36:51 +08:00
Small cleanups (2)
- fix a small compile error under MSVC - improve sigmoid comment and assert - fix formatting in README.md closes https://github.com/official-stockfish/Stockfish/pull/3960 No functional change
This commit is contained in:
committed by
Stéphane Nicolet
parent
004ea2c25e
commit
f3a2296e59
@@ -152,7 +152,7 @@ private:
|
||||
/// - the slope can be adjusted using C > 0, smaller C giving a steeper sigmoid
|
||||
/// - the slope of the sigmoid when t = x0 is P/(Q*C)
|
||||
/// - sigmoid is increasing with t when P > 0 and Q > 0
|
||||
/// - to get a decreasing sigmoid, call with -t, or change sign of P
|
||||
/// - to get a decreasing sigmoid, change sign of P
|
||||
/// - mean value of the sigmoid is y0
|
||||
///
|
||||
/// Use <https://www.desmos.com/calculator/jhh83sqq92> to draw the sigmoid
|
||||
@@ -163,7 +163,8 @@ inline int64_t sigmoid(int64_t t, int64_t x0,
|
||||
int64_t P,
|
||||
int64_t Q)
|
||||
{
|
||||
assert(C > 0 && Q != 0);
|
||||
assert(C > 0);
|
||||
assert(Q != 0);
|
||||
return y0 + P * (t-x0) / (Q * (std::abs(t-x0) + C)) ;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,8 +107,8 @@ void MovePicker::score() {
|
||||
|
||||
for (auto& m : *this)
|
||||
if constexpr (Type == CAPTURES)
|
||||
m.value = 6 * PieceValue[MG][pos.piece_on(to_sq(m))]
|
||||
+ (*captureHistory)[pos.moved_piece(m)][to_sq(m)][type_of(pos.piece_on(to_sq(m)))];
|
||||
m.value = 6 * int(PieceValue[MG][pos.piece_on(to_sq(m))])
|
||||
+ (*captureHistory)[pos.moved_piece(m)][to_sq(m)][type_of(pos.piece_on(to_sq(m)))];
|
||||
|
||||
else if constexpr (Type == QUIETS)
|
||||
m.value = (*mainHistory)[pos.side_to_move()][from_to(m)]
|
||||
|
||||
Reference in New Issue
Block a user