MCPcopy Create free account
hub / github.com/dds-bridge/dds / undo_0_ctx

Function undo_0_ctx

library/src/ab_search.cpp:1017–1044  ·  view source on GitHub ↗

ctx-enabled version that reads winners via the SearchContext facade

Source from the content-addressed store, hash-verified

1015
1016// ctx-enabled version that reads winners via the SearchContext facade
1017static void undo_0_ctx(
1018 Pos * posPoint,
1019 const int depth,
1020 const MoveType& mply,
1021 SolverContext& ctx)
1022{
1023 // No timers here; macros not used in this helper
1024 int h = HAND_ID(posPoint->first[depth], 3);
1025 int s = mply.suit;
1026 int r = mply.rank;
1027
1028 posPoint->rank_in_suit[h][s] |= bit_map_rank[r];
1029 posPoint->aggr[s] |= bit_map_rank[r];
1030 posPoint->hand_dist[h] += handDelta[s];
1031 posPoint->length[h][s]++;
1032
1033 // Changes that we now undo.
1034 WinnersType const * wp = &ctx.search().winners((depth + 3) >> 2);
1035
1036 for (int n = 0; n < wp->number; n++)
1037 {
1038 int st = wp->winner[n].suit;
1039 posPoint->winner[st].rank = wp->winner[n].winnerRank;
1040 posPoint->winner[st].hand = wp->winner[n].winnerHand;
1041 posPoint->second_best[st].rank = wp->winner[n].secondRank;
1042 posPoint->second_best[st].hand = wp->winner[n].secondHand;
1043 }
1044}
1045
1046
1047void undo_0_simple(

Callers 1

ab_search_3_ctxFunction · 0.85

Calls 2

winnersMethod · 0.80
searchMethod · 0.80

Tested by

no test coverage detected