| 97 | } |
| 98 | |
| 99 | void DataPositions::print_cost() const |
| 100 | { |
| 101 | ifstream file("cost"); |
| 102 | bool print_verbose = file.good(); |
| 103 | double total_cost = 0; |
| 104 | for (int i = 0; i < N_DATA_FIELD_TYPE; i++) |
| 105 | { |
| 106 | if (accumulate(files[i].begin(), files[i].end(), 0) > 0) |
| 107 | cerr << " Type " << field_names[i] << endl; |
| 108 | bool reading_field = true; |
| 109 | for (int j = 0; j < N_DTYPE; j++) |
| 110 | process_line(files[i][j], dtype_names[j], file, print_verbose, total_cost, reading_field); |
| 111 | |
| 112 | long long n_inputs = 0; |
| 113 | stringstream ss; |
| 114 | ss << " ("; |
| 115 | for (auto& x : inputs) |
| 116 | { |
| 117 | n_inputs += x[i]; |
| 118 | ss << x[i] << " "; |
| 119 | } |
| 120 | string s = ss.str(); |
| 121 | s.pop_back(); |
| 122 | s += ")"; |
| 123 | process_line(n_inputs, "Input tuples", file, print_verbose, total_cost, reading_field, s); |
| 124 | |
| 125 | for (map<DataTag, long long>::const_iterator it = extended[i].begin(); |
| 126 | it != extended[i].end(); it++) |
| 127 | { |
| 128 | cerr.fill(' '); |
| 129 | cerr << setw(27) << it->second << " " << setw(14) << it->first.get_string() << endl; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | if (total_cost > 0) |
| 134 | cerr << "Total cost: " << total_cost << endl; |
| 135 | |
| 136 | if (not edabits.empty()) |
| 137 | cerr << " edaBits" << endl; |
| 138 | for (auto it = edabits.begin(); it != edabits.end(); it++) |
| 139 | { |
| 140 | if (it->second) |
| 141 | { |
| 142 | if (print_verbose) |
| 143 | cerr << setw(13) << ""; |
| 144 | cerr << " " << setw(10) << it->second << " of length " |
| 145 | << it->first.second; |
| 146 | if (it->first.first) |
| 147 | cerr << " (strict)"; |
| 148 | cerr << endl; |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | void DataPositions::process_line(long long items_used, const char* name, |
| 154 | ifstream& file, bool print_verbose, double& total_cost, |
no test coverage detected