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

Function loop_calc

library/tests/loop.cpp:92–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91
92bool loop_calc(
93 DdTableDealsPBN * dealsp,
94 DdTablesRes * resp,
95 AllParResults * parp,
96 DealPBN * deal_list,
97 DdTableResults * table_list,
98 const int number,
99 const int stepsize)
100{
101#ifdef BATCHTIMES
102 cout << setw(8) << left << "Hand no." <<
103 setw(25) << right << "Time" << "\n";
104#endif
105
106 int filter[5] = {0, 0, 0, 0, 0};
107
108 for (int i = 0; i < number; i += stepsize)
109 {
110 int count = (i + stepsize > number ? number - i : stepsize);
111 dealsp->no_of_tables = count;
112 for (int j = 0; j < count; j++)
113 strcpy(dealsp->deals[j].cards, deal_list[i+j].remainCards);
114
115 timer.start(count);
116 int ret;
117 if ((ret = CalcAllTablesPBN(dealsp, -1, filter, resp, parp))
118 != RETURN_NO_FAULT)
119 {
120 cout << "loop_calc: i " << i << ", return " << ret << "\n";
121 exit(0);
122 }
123 timer.end();
124
125#ifdef BATCHTIMES
126 timer.print_running(i+count, number);
127#endif
128
129 for (int j = 0; j < count; j++)
130 {
131 if (compare_TABLE(resp->results[j], table_list[i + j]))
132 continue;
133
134 cout << "loop_calc: i " << i << ", j " << j << ": " <<
135 "Difference\n\n";
136 print_TABLE(resp->results[j] );
137 cout << "\n";
138 print_TABLE(table_list[i + j]) ;
139 cout << "\n";
140 }
141 }
142
143#ifdef BATCHTIMES
144 cout << "\n";
145#endif
146
147 return true;
148}
149

Callers 1

real_mainFunction · 0.85

Calls 6

CalcAllTablesPBNFunction · 0.85
compare_TABLEFunction · 0.85
print_TABLEFunction · 0.85
startMethod · 0.80
endMethod · 0.80
print_runningMethod · 0.80

Tested by

no test coverage detected