*
* @param rows Number of rows in the given matrix
* @param cols Number of cols in the given matrix
- * @param width Element width for matrix dumping
* @param match_type The type of matching:
* HUNGARIAN_MATCH_PERFECT - every nodes matches another node
* HUNGARIAN_MATCH_NORMAL - matchings of nodes having no edge getting removed
* @return The problem object.
*/
-hungarian_problem_t *hungarian_new(int rows, int cols, int width, int match_type);
+hungarian_problem_t *hungarian_new(int rows, int cols, int match_type);
/**
* Adds an edge from left to right with some costs.
* Print the cost matrix.
* @param p The hungarian object
*/
-void hungarian_print_costmatrix(hungarian_problem_t *p);
+void hungarian_print_costmatrix(hungarian_problem_t *p, int cost_width);
#endif /* _HUNGARIAN_H_ */
int num_rows; /**< number of rows */
int num_cols; /**< number of columns */
int **cost; /**< the cost matrix */
- int width; /**< the width for cost matrix dumper */
int max_cost; /**< the maximal costs in the matrix */
int match_type; /**< PERFECT or NORMAL matching */
bitset_t *missing_left; /**< left side nodes having no edge to the right side */
DEBUG_ONLY(firm_dbg_module_t *dbg);
};
-static inline void *get_init_mem(struct obstack *obst, long sz) {
+static inline void *get_init_mem(struct obstack *obst, size_t sz) {
void *p = obstack_alloc(obst, sz);
memset(p, 0, sz);
return p;
fprintf(f, "\n");
}
-void hungarian_print_costmatrix(hungarian_problem_t *p) {
- hungarian_dump_f(stderr, p->cost, p->num_rows, p->num_cols, p->width);
+void hungarian_print_costmatrix(hungarian_problem_t *p, int width) {
+ hungarian_dump_f(stderr, p->cost, p->num_rows, p->num_cols, width);
}
/**
* Create the object and allocate memory for the data structures.
*/
-hungarian_problem_t *hungarian_new(int rows, int cols, int width, int match_type) {
+hungarian_problem_t *hungarian_new(int rows, int cols, int match_type) {
int i;
hungarian_problem_t *p = XMALLOCZ(hungarian_problem_t);
p->num_rows = rows;
p->num_cols = cols;
- p->width = width;
p->match_type = match_type;
/*
if (pset_count(dvg->edges) == 0)
return NULL;
- bp = hungarian_new(n, n, 1, HUNGARIAN_MATCH_NORMAL);
+ bp = hungarian_new(n, n, HUNGARIAN_MATCH_NORMAL);
/*
At first, we build an index map for the nodes in the DVG,