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

Function solve_single_common

library/src/solve_board.cpp:37–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36
37auto solve_single_common(
38 const int thrId,
39 const int bno) -> void
40{
41 FutureTricks fut;
42
43 // Fallback timing: measure per-board elapsed time (ms) even when
44 // DDS_SCHEDULER isn't enabled at compile time. This allows the
45 // dtest -r/--report option to print per-board timings.
46 START_THREAD_TIMER(thrId);
47 auto t0 = std::chrono::steady_clock::now();
48 int res = SolveBoard(
49 param.bop->deals[bno],
50 param.bop->target[bno],
51 param.bop->solutions[bno],
52 param.bop->mode[bno],
53 &fut,
54 thrId);
55 auto t1 = std::chrono::steady_clock::now();
56 END_THREAD_TIMER(thrId);
57
58 // Compute elapsed milliseconds and publish to scheduler as a
59 // lightweight fallback. Scheduler will ignore or use this value
60 // when reporting if full DDS_SCHEDULER timing is not active.
61 auto dur = std::chrono::duration_cast<std::chrono::milliseconds>(t1 - t0).count();
62 if (dur < 0) dur = 0;
63 scheduler.SetBoardTime(bno, static_cast<int>(dur));
64
65 if (res == 1)
66 param.solvedp->solved_board[bno] = fut;
67 else
68 param.error = res;
69}
70
71
72auto copy_solve_single(const vector<int>& crossrefs) -> void

Callers 2

solve_chunk_commonFunction · 0.85
solve_all_boards_nFunction · 0.85

Calls 2

SetBoardTimeMethod · 0.80
SolveBoardFunction · 0.70

Tested by

no test coverage detected