| 90 | |
| 91 | |
| 92 | bool 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 |
no test coverage detected