Count edges for each sample block. This function can be parallelized. */
| 1056 | |
| 1057 | /** Count edges for each sample block. This function can be parallelized. */ |
| 1058 | void count(size_t start, size_t end, int id) { |
| 1059 | auto &offsets = solver->pool_offsets[id + 1]; |
| 1060 | for (size_t i = start; i < end; i++) { |
| 1061 | Index head_global_id = std::get<0>((*solver->samples)[i]); |
| 1062 | Index tail_global_id = std::get<1>((*solver->samples)[i]); |
| 1063 | int head_partition_id = solver->head_locations[head_global_id].first; |
| 1064 | int tail_partition_id = solver->tail_locations[tail_global_id].first; |
| 1065 | offsets[head_partition_id][tail_partition_id]++; |
| 1066 | } |
| 1067 | } |
| 1068 | |
| 1069 | /** Count edges for each sample block. This function can be parallelized. */ |
| 1070 | void count_numpy(size_t start, size_t end, int id) { |