Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
ff7766fa
Commit
ff7766fa
authored
Sep 20, 2006
by
Christian Würdig
Browse files
changed solve function, return now 0 or negative on number, cost are pointer param
[r8279]
parent
b708863f
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/adt/hungarian.c
View file @
ff7766fa
...
...
@@ -184,7 +184,7 @@ void hungarian_free(hungarian_problem_t* p) {
/**
* Do the assignment.
*/
int
hungarian_solve
(
hungarian_problem_t
*
p
,
int
*
assignment
)
{
int
hungarian_solve
(
hungarian_problem_t
*
p
,
int
*
assignment
,
int
*
final_cost
)
{
int
i
,
j
,
m
,
n
,
k
,
l
,
s
,
t
,
q
,
unmatched
,
cost
;
int
*
col_mate
;
int
*
row_mate
;
...
...
@@ -442,5 +442,7 @@ done:
xfree
(
unchosen_row
);
xfree
(
col_mate
);
return
cost
;
*
final_cost
=
cost
;
return
0
;
}
ir/adt/hungarian.h
View file @
ff7766fa
...
...
@@ -76,9 +76,10 @@ void hungarian_free(hungarian_problem_t *p);
* This method computes the optimal assignment.
* @param p The hungarian object
* @param assignment The final assignment
* @return The resulting cost or a negative value if matching is invalid.
* @param final_cost The final costs
* @return 0 on success, negative number otherwise
*/
int
hungarian_solve
(
hungarian_problem_t
*
p
,
int
*
assignment
);
int
hungarian_solve
(
hungarian_problem_t
*
p
,
int
*
assignment
,
int
*
final_cost
);
/**
* Print the cost matrix.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment