munkres-cpp
munkres-cpp copied to clipboard
Support other matrix data type classes.
Support other matrix data type classes from other libs (boost)?
UPD Implemented:
-
std::array
(C++11); - raw (C-style) array;
-
boost::numeric::ublas::matrix
; -
std::vector <std::vector <double> >
.
To make Matrix
data type generalized, I see two ways:
- first: involve abstract data type with pure methods (which will describe interface);
- second:
Munkres
class should become template which will be parameterized by specificMatrix
data type.
I would prefer, second way because (in my opinion) that would be better for performance. But first way (in my opinion) would be more graceful.
What do you think about it? Do you have other solutions or ideas?
Maybe instead, modify Matrix to copy in and out of other implementations' instances?
Oh! It seems I misunderstood the ticket's aim! If the aim is extend interface, your solution will enough.
I thought, that you want to try solve assignment problem on different Matrix
types (may be to research performance issues)!
I was aiming mainly to make it easier to use this code from within existing code. I don't think it would hurt to have the Munkres class as a template, additionally.
When I see changes which was made according to this issue, I'm not satisfied. There are a lot of classes of matrices: Qt, opencv, Eigen, etc... So it's impossible implement adaptors for all of them. It's require more generic approach. Also existed adapters pollute code.