#include <munkres.h>
Definition at line 17 of file munkres.h.
◆ coords
◆ matrix_type
◆ result_type
◆ vec_type
◆ markertype
◆ munkres()
Definition at line 8 of file munkres.cxx.
8 :
13{
18}
std::vector< bool > m_colIsCovered
std::vector< double > vec_type
std::vector< bool > m_rowIsCovered
◆ augment_path()
| void munkres::augment_path |
( |
const std::vector< coords > & | path | ) |
|
|
private |
Definition at line 183 of file munkres.cxx.
183 {
184 for(
unsigned int i = 0;
i<
p.size();++
i){
185 const int row =
p[
i].first;
186 const int col =
p[
i].second;
189 }
190 else{
192 }
193 }
194}
row
Appending html table to final .html summary file.
◆ erase_primes_and_covers()
| void munkres::erase_primes_and_covers |
( |
| ) |
|
|
private |
Definition at line 196 of file munkres.cxx.
196 {
200 for(
int col=0;col<
m_dim;++col){
202 }
203 }
204}
◆ find_a_zero()
| void munkres::find_a_zero |
( |
int & | row, |
|
|
int & | col ) |
|
private |
Definition at line 126 of file munkres.cxx.
126 {
128 for(col=0;col<
m_dim;++col){
130 }
131 }
132
134 col = -1;
135}
◆ find_in_col()
| int munkres::find_in_col |
( |
const int | col, |
|
|
markertype | what ) |
|
private |
Definition at line 143 of file munkres.cxx.
143 {
145
146 return -1;
147}
◆ find_in_row()
| int munkres::find_in_row |
( |
const int | row, |
|
|
markertype | what ) |
|
private |
Definition at line 137 of file munkres.cxx.
137 {
139
140 return -1;
141}
◆ find_min_uncov()
| double munkres::find_min_uncov |
( |
| ) |
|
|
private |
Definition at line 247 of file munkres.cxx.
247 {
250 for(
int col=0;col<
m_dim;++col){
253 }
254 }
255 }
257}
◆ printcosts()
| void munkres::printcosts |
( |
| ) |
|
|
inline |
Definition at line 27 of file munkres.h.
void printmatrix(const matrix_type &)
◆ printmask()
| void munkres::printmask |
( |
| ) |
|
|
inlineprivate |
◆ printmatrix()
Definition at line 275 of file munkres.cxx.
275 {
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;
281
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 << " ";
289 std::cout << "|";
290 } std::cout << std::endl;
291 }
292}
◆ run()
Definition at line 20 of file munkres.cxx.
20 {
22 bool done = false;
24 while(!done){
26 std::cout <<
"doing step " <<
m_step << std::endl;
29 }
31 case 1:
33 break;
34 case 2:
36 break;
37 case 3:
39 break;
40 case 4:
42 break;
43 case 5:
45 break;
46 case 6:
48 break;
49 case 7:
50 done = true;
51 break;
52 }
53 }
54 if(
debug) std::cout <<
"done running munkres algorithm: " << std::endl;
56 costvector.clear();
57
62 }
63
66 for(
uint i=0;
i<
result.size();++
i) std::cout <<
"row: " << i <<
" -> col: " << result[i] <<
" cost: " <<
m_costs_orig[i][result[i]]<< std::endl;
67 }
69}
std::vector< int > result_type
int find_in_row(const int row, markertype what)
◆ step_five()
| void munkres::step_five |
( |
| ) |
|
|
private |
Definition at line 206 of file munkres.cxx.
206 {
207
208
209
210
211
212
213
214
215 bool done = false;
216 std::vector<coords>
path;
219
221
223 while(!done && n<4){
n++;
225 if(starred0atrow > -1){
227 }
228 else{
229 done = true;
230 }
231 if(!done){
234 }
235 }
236
237
238
239
240
243
245}
int find_in_col(const int col, markertype what)
void augment_path(const std::vector< coords > &path)
void erase_primes_and_covers()
void find_a_zero(int &row, int &col)
std::pair< int, int > coords
path
python interpreter configuration --------------------------------------—
◆ step_four()
| void munkres::step_four |
( |
| ) |
|
|
private |
Definition at line 149 of file munkres.cxx.
149 {
150
151
152
153
154
155
156 bool done = false;
157 while(!done){
160 if(row == -1){
161
162 done = true;
164 }
165 else{
166
167
170 if(starred0atcol != -1){
173
174
175 }else{
176 done = true;
178 }
179 }
180 }
181}
◆ step_one()
| void munkres::step_one |
( |
| ) |
|
|
private |
Definition at line 71 of file munkres.cxx.
71 {
72
73
76 for(
int col=0;col<
m_dim;++col){
78 }
79 for(
int col=0;col<
m_dim;++col){
81 }
82 }
84}
◆ step_six()
| void munkres::step_six |
( |
| ) |
|
|
private |
Definition at line 259 of file munkres.cxx.
259 {
260
261
262
263
264
267 for(
int col=0;col<
m_dim;++col){
270 }
271 }
273}
◆ step_three()
| void munkres::step_three |
( |
| ) |
|
|
private |
Definition at line 109 of file munkres.cxx.
109 {
110
111
112
113
115 for(
int col=0;col<
m_dim;++col){
117 }
118 }
119
120 int nCoveredCols = 0;
122
124}
◆ step_two()
| void munkres::step_two |
( |
| ) |
|
|
private |
Definition at line 86 of file munkres.cxx.
86 {
87
88
89
90
91
93 for(
int col=0;col<
m_dim;++col){
98 }
99 }
100 }
101
105 }
107}
◆ m_colIsCovered
| std::vector<bool> munkres::m_colIsCovered |
|
private |
◆ m_costmatrix
◆ m_costs_orig
◆ m_dim
◆ m_maskmatrix
◆ m_rowIsCovered
| std::vector<bool> munkres::m_rowIsCovered |
|
private |
◆ m_step
The documentation for this class was generated from the following files: