THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
736B

  1. #ifndef LINEAR_ASSIGNMENT_H
  2. #define LINEAR_ASSIGNMENT_H
  3. /*
  4. * Compute an assignment of columns -> rows (and vice versa) such that every
  5. * column is assigned to at most one row (and vice versa) minimizing the
  6. * overall cost.
  7. *
  8. * The parameter `cost` is the cost matrix: the cost to assign column j to row
  9. * i is `cost[j + column_count * i].
  10. *
  11. * The arrays column2row and row2column will be populated with the respective
  12. * assignments (-1 for unassigned, which can happen only if column_count !=
  13. * row_count).
  14. */
  15. void compute_assignment(int column_count, int row_count, int *cost,
  16. int *column2row, int *row2column);
  17. /* The maximal cost in the cost matrix (to prevent integer overflows). */
  18. #define COST_MAX (1<<16)
  19. #endif