X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Fadt%2Fbipartite.h;h=4d89079f5ae8c8a1190a20639064d9092fca46ac;hb=cdcd17c48e951c6e0201c58b94aaf52a8769703c;hp=f6389a100245e80c1285eedbbb7e0b46a7b1d6a7;hpb=1ce363f80e6a204d4011f85813362d9bd1d0e7e4;p=libfirm diff --git a/include/libfirm/adt/bipartite.h b/include/libfirm/adt/bipartite.h index f6389a100..4d89079f5 100644 --- a/include/libfirm/adt/bipartite.h +++ b/include/libfirm/adt/bipartite.h @@ -26,23 +26,46 @@ #ifndef FIRM_ADT_BIPARTITE_H #define FIRM_ADT_BIPARTITE_H -typedef struct _bipartite_t bipartite_t; +#include "../begin.h" -bipartite_t *bipartite_new(int n_left, int n_right); -void bipartite_free(bipartite_t *gr); -void bipartite_add(bipartite_t *gr, int i, int j); -void bipartite_remv(bipartite_t *gr, int i, int j); -int bipartite_adj(const bipartite_t *gr, int i, int j); -void bipartite_matching(const bipartite_t *gr, int *matching); +/** + * @ingroup algorithms + * @defgroup bipartite Bipartite Matching + * Solved bipartite matching problem. + * (Variant with only 0/1 costs) + * @{ + */ + +/** internal representation of bipartite matching problem */ +typedef struct bipartite_t bipartite_t; + +/** Create new bipartite matching problem with @p n_left elements on left side + * and @p n_right elements on right side */ +FIRM_API bipartite_t *bipartite_new(int n_left, int n_right); +/** Free memory occupied by bipartite matching problem */ +FIRM_API void bipartite_free(bipartite_t *gr); +/** Add edge from @p i (on the left side) to @p j (on the right side) */ +FIRM_API void bipartite_add(bipartite_t *gr, int i, int j); +/** Remove edge from @p i (on the left side) to @p j (on the right side) */ +FIRM_API void bipartite_remv(bipartite_t *gr, int i, int j); +/** Return 1 if edge from @p i (on the left side) to @p j (on the right side) + * exists, 0 otherwise */ +FIRM_API int bipartite_adj(const bipartite_t *gr, int i, int j); +/** Solve bipartite matching problem */ +FIRM_API void bipartite_matching(const bipartite_t *gr, int *matching); /** * Dumps a bipartite graph to a file stream. */ -void bipartite_dump_f(FILE *f, const bipartite_t *gr); +FIRM_API void bipartite_dump_f(FILE *f, const bipartite_t *gr); /** * Dumps a bipartite graph to file name. */ -void bipartite_dump(const char *name, const bipartite_t *gr); +FIRM_API void bipartite_dump(const char *name, const bipartite_t *gr); + +/** @} */ + +#include "../end.h" #endif /* _BIPARTITE_H */