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

Function solve_same_board

library/src/solver_if.cpp:682–808  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680
681
682auto solve_same_board(
683 SolverContext& ctx,
684 const Deal& dl,
685 FutureTricks * futp,
686 const int hint) -> int
687{
688 // Specialized function for SolveChunkDDtable for repeat solves.
689 // No further parameter checks! This function makes heavy reuse
690 // of parameters that are already stored in various places. It
691 // corresponds to:
692 // target == -1, solutions == 1, mode == 2.
693 // The function only needs to return fut.score[0].
694
695 auto thrp = ctx.thread();
696 int ini_depth = ctx.search().ini_depth();
697 int trick = (ini_depth + 3) >> 2;
698 {
699 ctx.search().trick_nodes() = 0;
700 }
701
702 thrp->lookAheadPos.first[ini_depth] = dl.first;
703
704 {
705 if (dl.first == 0 || dl.first == 2)
706 {
707 ctx.search().node_type_store(0) = MAXNODE;
708 ctx.search().node_type_store(1) = MINNODE;
709 ctx.search().node_type_store(2) = MAXNODE;
710 ctx.search().node_type_store(3) = MINNODE;
711 }
712 else
713 {
714 ctx.search().node_type_store(0) = MINNODE;
715 ctx.search().node_type_store(1) = MAXNODE;
716 ctx.search().node_type_store(2) = MINNODE;
717 ctx.search().node_type_store(3) = MAXNODE;
718 }
719 }
720
721#ifdef DDS_AB_STATS
722 thrp->ABStats.Reset();
723 thrp->ABStats.ResetCum();
724#endif
725
726#ifdef DDS_TOP_LEVEL
727 {
728 ctx.search().nodes() = 0;
729 }
730#endif
731
732 ctx.move_gen().reinit(trick, dl.first);
733
734 int guess = hint;
735 int lowerbound = 0;
736 int upperbound = 13;
737
738 do
739 {

Callers 1

Calls 15

ab_searchFunction · 0.85
DumpTopLevelFunction · 0.85
ThreadMemoryUsedFunction · 0.85
threadMethod · 0.80
ini_depthMethod · 0.80
searchMethod · 0.80
trick_nodesMethod · 0.80
node_type_storeMethod · 0.80
ResetCumMethod · 0.80
nodesMethod · 0.80
reinitMethod · 0.80
move_genMethod · 0.80

Tested by

no test coverage detected