IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Munkres.h
1 // Munkres.h:
3 // ----------
4 //
24 
25 #ifndef __IPSDKMATH_MUNKRES_H__
26 #define __IPSDKMATH_MUNKRES_H__
27 
28 // suppression warnings
29 // warning C4251: 'ipsdk::math::Munkres::_inputWeights' : class 'std::vector<ipsdk::ipReal64,std::allocator<_Ty>>' needs to have dll-interface to be used by clients of class 'ipsdk::math::Munkres'
30 // warning C4275: interface non dll class 'boost::noncopyable_::noncopyable' utilisée comme base d'une interface dll class 'ipsdk::math::Munkres'
31 #pragma warning (push)
32 #pragma warning (disable : 4275 4251)
33 
36 #include <boost/noncopyable.hpp>
37 
38 namespace ipsdk {
39 namespace math {
40 
43 
44 class IPSDKMATH_API Munkres : public boost::noncopyable
45 {
46 public:
49  Munkres();
50  ~Munkres();
52 
53 // methods
54 public:
56  bool isInit() const;
57 
63  void init(const ipUInt32 nbRows, const ipUInt32 nbColumns);
64 
68  ipUInt32 getNbRows() const;
69 
73  ipUInt32 getNbColumns() const;
74 
79  ipReal64* getWeights(const ipUInt32 rowIdx);
80 
84  const ipReal64* getWeights(const ipUInt32 rowIdx) const;
85 
91  ipReal64 getWeight(const ipUInt32 rowIdx,
92  const ipUInt32 columnIdx) const;
93 
97  bool isSolved() const;
98 
102  void solve();
103 
109  const UInt32Vector& getAssignments() const;
110 
114  ipReal64 getTotalWeigth();
115 
117  void clear();
118 
119 // attributes
120 protected:
123 
126 
129 
132 };
133 
136 
137 inline bool
139 {
140  return _inputWeights.empty() == false;
141 }
142 
145 
146 } // end of namespace math
147 } // end of namespace ipsdk
148 
149 #pragma warning (pop)
150 
151 #endif // __IPSDKMATH_MUNKRES_H__
Definition of import/export macro for library.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
std::vector< ipUInt32 > UInt32Vector
stl vector collections
Definition: BaseCollections.h:33
std::vector< ipReal64 > Real64Vector
stl vector collections
Definition: BaseCollections.h:37
Implementation of munkres algorithm.
Definition: Munkres.h:44
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Real64Vector _inputWeights
input matrix data associated to algorithm
Definition: Munkres.h:128
#define IPSDKMATH_API
Import/Export macro for library IPSDKMath.
Definition: IPSDKMathExports.h:27
bool isInit() const
check for object initialization
Definition: Munkres.h:138
UInt32Vector _assignments
assignment vector associated to problem solution
Definition: Munkres.h:131
Predefined base collection types for library.
ipUInt32 _nbRows
number of rows for matrix associated to algorithm
Definition: Munkres.h:122
ipUInt32 _nbColumns
number of columns for matrix associated to algorithm
Definition: Munkres.h:125
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53