6#include "boost/io/ios_state.hpp"
26 std::cout <<
"doing step " <<
m_step << std::endl;
54 if(
debug) std::cout <<
"done running munkres algorithm: " << std::endl;
58 for(
int row=0;row<
m_dim;++row){
74 for(
int row=0;row<
m_dim;++row){
76 for(
int col=0;col<
m_dim;++col){
79 for(
int col=0;col<
m_dim;++col){
92 for(
int row=0;row<
m_dim;++row){
93 for(
int col=0;col<
m_dim;++col){
102 for(
int i=0;i<
m_dim;++i){
114 for(
int row=0;row<
m_dim;++row){
115 for(
int col=0;col<
m_dim;++col){
120 int nCoveredCols = 0;
127 for(row=0;row<
m_dim;++row){
128 for(col=0;col<
m_dim;++col){
170 if(starred0atcol != -1){
184 for(
unsigned int i = 0;i<p.size();++i){
185 const int row = p[i].first;
186 const int col = p[i].second;
197 for(
int row=0;row<
m_dim;++row){
200 for(
int col=0;col<
m_dim;++col){
216 std::vector<coords> path;
220 path.push_back(
coords(row,col));
223 while(!done && n<4){n++;
225 if(starred0atrow > -1){
226 path.push_back(
coords(starred0atrow,path.back().second));
233 path.push_back(
coords(path.back().first,primed0atcol));
249 for(
int row=0;row<
m_dim;++row){
250 for(
int col=0;col<
m_dim;++col){
266 for(
int row=0;row<
m_dim;++row){
267 for(
int col=0;col<
m_dim;++col){
276 boost::io::ios_all_saver ias(std::cout);
277 std::cout << std::setw(5) << std::setprecision(3) <<
"cov|";
278 for(
int col=0;col<
m_dim;++col){
279 std::cout << std::setw(7) << std::setprecision(3) << (
m_colIsCovered[col] ?
"+|" :
"|");
280 } std::cout << std::endl;
282 for(
int row=0;row<
m_dim;++row){
283 std::cout << std::setw(5) << std::setprecision(3) << (
m_rowIsCovered[row] ?
"+ |" :
"|");
284 for(
int col=0;col<
m_dim;++col){
285 std::cout << std::setw(5) << std::setprecision(3) << m[row][col];
288 else std::cout <<
" ";
290 } std::cout << std::endl;
munkres(matrix_type costs)
int find_in_col(const int col, markertype what)
void augment_path(const std::vector< coords > &path)
std::vector< vec_type > matrix_type
void erase_primes_and_covers()
void printmatrix(const matrix_type &)
void find_a_zero(int &row, int &col)
result_type run(vec_type &costvector, bool debug=false)
std::vector< int > result_type
std::vector< bool > m_colIsCovered
std::vector< double > vec_type
int find_in_row(const int row, markertype what)
std::pair< int, int > coords
std::vector< bool > m_rowIsCovered