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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
* @file calc_dd_table.hpp
* @brief C++ interface for double dummy table calculation with explicit solver context.
*
* This header provides C++ overloads for DD table calculation that accept explicit
* SolverContext, allowing clients to manage solver state and transposition tables
* across multiple table calculations.
*
* @copyright (C) 2006-2014 by Bo Haglund / 2014-2018 by Bo Haglund & Soren Hein.
* @see LICENSE and README.
*/
// Naming note: New C++ APIs in DDS 3 use snake_case (calc_dd_table).
// Legacy C API names remain PascalCase (CalcDDtable).
/**
* @brief Calculate double dummy table for a deal (creates temporary context).
*
* Computes the double dummy table showing maximum tricks for each strain
* and declarer. This version creates a temporary SolverContext internally.
*
* @param table_deal Deal represented as card holdings for each hand
* @param table_results Output: double dummy table results (5 strains x 4 declarers)
* @return Error code (RETURN_NO_FAULT on success)
*
* @note For repeated calculations, prefer calc_dd_table(ctx, ...) to reuse context
*/
auto int;
/**
* @brief Calculate double dummy table with explicit solver context.
*
* C++ overload that accepts an explicit SolverContext, allowing clients
* to reuse solver state and allocated resources across multiple table
* calculations.
*
* @param ctx Solver context containing state and allocated solver resources
* @param table_deal Deal represented as card holdings for each hand
* @param table_results Output: double dummy table results (5 strains x 4 declarers)
* @return Error code (RETURN_NO_FAULT on success)
*
* @note Reusing the same context avoids per-call setup and allocation costs.
* DD-table calculations iterate all strains, so TT entry reuse across
* calls may be limited depending on call patterns.
*/
auto int;
/**
* @brief Calculate double dummy table from PBN deal (creates temporary context).
*
* Convenience overload that accepts PBN format deal string and delegates
* to binary format calculation after conversion.
*
* @param table_deal_pbn Deal in PBN format
* @param table_results Output: double dummy table results
* @return Error code (RETURN_NO_FAULT on success, RETURN_PBN_FAULT on parse error)
*/
auto int;
/**
* @brief Calculate double dummy table from PBN deal with explicit context.
*
* Context-aware overload accepting PBN format. Converts and delegates to
* binary format calculation with context reuse.
*
* @param ctx Solver context for resource management
* @param table_deal_pbn Deal in PBN format
* @param table_results Output: double dummy table results
* @return Error code (RETURN_NO_FAULT on success, RETURN_PBN_FAULT on parse error)
*/
auto int;