Let list_for_each_entry(), list_for_each_entry_reverse() and list_for_each_entry_safe...
[libfirm] / include / libfirm / adt / hungarian.h
index fa44bae..7d1b85e 100644 (file)
 /**
  * @file
  * @brief   Solving the Minimum Assignment Problem using the Hungarian Method.
- * @version $Id$
  */
 #ifndef FIRM_ADT_HUNGARIAN_H
 #define FIRM_ADT_HUNGARIAN_H
 
 #include "../begin.h"
 
+/**
+ * @ingroup algorithms
+ * @defgroup hungarian Hungarian Algorithm
+ * Solves bipartite matching problems (minimize/maximize cost function)
+ * @{
+ */
+
+/** type of matching */
 typedef enum match_type_t {
        HUNGARIAN_MATCH_NORMAL,   /**< ever nodes matches another node */
        HUNGARIAN_MATCH_PERFECT   /**< matchings of nodes having no edge getting
                                       removed */
 } match_type_t;
 
+/** mode of matching (the optimization goal) */
 typedef enum hungarian_mode_t {
-       HUNGARIAN_MODE_MINIMIZE_COST,
-       HUNGARIAN_MODE_MAXIMIZE_UTIL
+       HUNGARIAN_MODE_MINIMIZE_COST, /**< minimize cost */
+       HUNGARIAN_MODE_MAXIMIZE_UTIL  /**< maximize cost */
 } hungarian_mode_t;
 
+/**
+ * Internal representation of a bipartite matching problem
+ */
 typedef struct hungarian_problem_t hungarian_problem_t;
 
 /**
@@ -77,7 +88,7 @@ FIRM_API void hungarian_remove(hungarian_problem_t *p, unsigned left,
  * Prepares the cost matrix dependent on the given mode.
  *
  * @param p     The hungarian object
- * @param mode  specify wether to minimize or maximize the costs
+ * @param mode  specify whether to minimize or maximize the costs
  */
 FIRM_API void hungarian_prepare_cost_matrix(hungarian_problem_t *p,
                                             hungarian_mode_t mode);
@@ -106,6 +117,8 @@ FIRM_API int hungarian_solve(hungarian_problem_t *p, unsigned *assignment,
 FIRM_API void hungarian_print_cost_matrix(hungarian_problem_t *p,
                                           int cost_width);
 
+/** @} */
+
 #include "../end.h"
 
 #endif