MeVisLab Toolbox Reference
Munkres.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2014, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #pragma once
14 
15 #include <vector>
16 
17 class Munkres
18 {
19 public:
20  Munkres(){}
21 
22  void runMunkres(std::vector < std::vector < float > >& matrix);
23 
24 private:
25  int** runMunkres(int** matrix, int n, bool max);
26 
27  void step_one(int** matrix, int n, int& step);
28  void step_two(int** matrix, int n, int* rowCover, int* colCover, int** m, int& step);
29  void step_three(int n, int* colCover, int** m, int& step);
30  void step_four(int** matrix, int n, int* rowCover, int* colCover, int** m, int& path_row_0, int& path_col_0, int& step);
31  void step_five(int n, int* rowCover, int* colCover, int** m, int& path_row_0, int& path_col_0, int& path_count, int** path, int& step);
32  void step_six(int** matrix, int n, int* rowCover, int* colCover, int& step);
33 
34  void find_a_zero(int** matrix, int n, int* rowCover, int* colCover, int& row, int& col);
35  bool star_in_row(int** m, int n, int row);
36  void find_star_in_row(int** m, int n, int row, int& col);
37  void find_star_in_col(int n, int** m, int c, int& r);
38  void find_prime_in_row(int n, int** m, int r, int& c);
39  void augment_path(int** m, int path_count, int** path);
40  void clear_covers(int n, int* rowCover, int* colCover);
41  void erase_primes(int n, int** m);
42  void find_smallest(int** matrix, int n, int* rowCover, int* colCover, int& minval);
43 };
void runMunkres(std::vector< std::vector< float > > &matrix)
Munkres()
Definition: Munkres.h:20