(cost_matrix, indices, thresh)
| 37 | |
| 38 | |
| 39 | def _indices_to_matches(cost_matrix, indices, thresh): |
| 40 | matched_cost = cost_matrix[tuple(zip(*indices))] |
| 41 | matched_mask = (matched_cost <= thresh) |
| 42 | |
| 43 | matches = indices[matched_mask] |
| 44 | unmatched_a = tuple(set(range(cost_matrix.shape[0])) - set(matches[:, 0])) |
| 45 | unmatched_b = tuple(set(range(cost_matrix.shape[1])) - set(matches[:, 1])) |
| 46 | |
| 47 | return matches, unmatched_a, unmatched_b |
| 48 | |
| 49 | |
| 50 | def linear_assignment(cost_matrix, thresh): |
nothing calls this directly
no outgoing calls
no test coverage detected