forked from dds-bridge/dds
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigration_example.cpp
More file actions
50 lines (40 loc) · 866 Bytes
/
Copy pathmigration_example.cpp
File metadata and controls
50 lines (40 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
DDS, a bridge double dummy solver.
Copyright (C) 2006-2014 by Bo Haglund /
2014-2018 by Bo Haglund & Soren Hein.
See LICENSE and README.
*/
#include <memory>
#include <api/dll.h>
#ifdef _VCXPROJ
#include <dds.hpp>
#else
#include <dds/dds.hpp>
#endif
void solve_legacy(const Deal& deal)
{
SetMaxThreads(4);
SetResources(2000, 4);
FutureTricks fut;
int res = SolveBoard(deal, -1, 3, 0, &fut, 0);
(void)res;
FreeMemory();
}
void solve_modern(const Deal& deal)
{
SolverConfig cfg;
cfg.tt_kind_ = TTKind::Large;
cfg.tt_mem_default_mb_ = 2000;
cfg.tt_mem_maximum_mb_ = 2000;
SolverContext ctx(cfg);
FutureTricks fut;
int res = solve_board(ctx, deal, -1, 3, 0, &fut);
(void)res;
}
auto main() -> int
{
Deal deal{};
solve_legacy(deal);
solve_modern(deal);
return 0;
}