vnl_hungarian_algorithm.h

来自「DTMK软件开发包,此为开源软件,是一款很好的医学图像开发资源.」· C头文件 代码 · 共 30 行

H
30
字号
#ifndef vnl_hungarian_algorithm_h_
#define vnl_hungarian_algorithm_h_

//:
// \file
// \author Amitha Perera
// \date   Sep 2004

#include <vcl_vector.h>
#include <vnl/vnl_matrix.h>

//: Find the best column to row assignment given a cost matrix.
//
// This is an implementation of the Hungarian algorithm (also known
// as the Munkres algorithm). It finds the minimum cost assignment of
// the rows of the cost matrix \a cost (workers) to the columns
// (jobs).
//
// \param cost An N x M cost matrix. The costs cannot be -Infinity.
//
// \returns A vector v of size N such that v[i] = j means that row i
// should be assigned to column j. \code v[i] = -1u \endcode (= \code
// unsigned(-1) \endcode ) means that row i was not assigned to any
// column. If N \> M, then every column will be assigned to some
// row. If N \< M then every row will be assigned to some column.
//
vcl_vector<unsigned> vnl_hungarian_algorithm( vnl_matrix<double> const& cost );

#endif // vnl_hungarian_algorithm_h_

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?