#include <hungarian.h>
Public Member Functions | |
const vector< vector< int > > & | assignment () const |
int | cost () const |
Hungarian () | |
Hungarian (const vector< vector< int > > &, int, int, MODE) | |
int | init (const vector< vector< int > > &input_matrix, int rows, int cols, MODE mode) |
void | print_assignment () |
void | print_cost () |
void | print_status () |
bool | solve () |
Protected Member Functions | |
bool | assign_solution (const vector< int > &row_dec, const vector< int > &col_inc, const vector< int > &col_vertex) |
bool | check_solution (const vector< int > &row_dec, const vector< int > &col_inc, const vector< int > &col_vertex) |
Private Attributes | |
vector< vector< int > > | m_assignment |
int | m_cols |
int | m_cost |
vector< vector< int > > | m_costmatrix |
int | m_rows |
Definition at line 41 of file hungarian.h.
This method initialize the hungarian_problem structure and init the cost matrices (missing lines or columns are filled with 0). It returns the size of the quadratic(!) assignment matrix.
Definition at line 33 of file hungarian.cpp.
Hungarian::Hungarian | ( | const vector< vector< int > > & | input_matrix, |
int | rows, | ||
int | cols, | ||
MODE | mode | ||
) |
Definition at line 44 of file hungarian.cpp.
bool Hungarian::assign_solution | ( | const vector< int > & | row_dec, |
const vector< int > & | col_inc, | ||
const vector< int > & | col_vertex | ||
) | [protected] |
Definition at line 225 of file hungarian.cpp.
const vector< vector< int > > & Hungarian::assignment | ( | ) | const |
Reference accessor for assignment
Definition at line 585 of file hungarian.cpp.
bool Hungarian::check_solution | ( | const vector< int > & | row_dec, |
const vector< int > & | col_inc, | ||
const vector< int > & | col_vertex | ||
) | [protected] |
Definition at line 189 of file hungarian.cpp.
int Hungarian::cost | ( | ) | const |
Accessor for the cost
Definition at line 580 of file hungarian.cpp.
int Hungarian::init | ( | const vector< vector< int > > & | input_matrix, |
int | rows, | ||
int | cols, | ||
MODE | mode | ||
) |
Definition at line 139 of file hungarian.cpp.
void Hungarian::print_assignment | ( | ) |
Print the computed optimal assignment.
Definition at line 120 of file hungarian.cpp.
void Hungarian::print_cost | ( | ) |
Print the cost matrix.
Definition at line 124 of file hungarian.cpp.
void Hungarian::print_status | ( | ) |
Print cost matrix and assignment matrix.
Definition at line 128 of file hungarian.cpp.
bool Hungarian::solve | ( | ) |
This method computes the optimal assignment.
Definition at line 262 of file hungarian.cpp.
vector<vector<int> > Hungarian::m_assignment [private] |
Definition at line 85 of file hungarian.h.
int Hungarian::m_cols [private] |
Definition at line 83 of file hungarian.h.
int Hungarian::m_cost [private] |
Definition at line 81 of file hungarian.h.
vector<vector<int> > Hungarian::m_costmatrix [private] |
Definition at line 84 of file hungarian.h.
int Hungarian::m_rows [private] |
Definition at line 82 of file hungarian.h.