munkres-cpp icon indicating copy to clipboard operation
munkres-cpp copied to clipboard

Support other matrix data type classes.

Open Gluttton opened this issue 11 years ago • 5 comments

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> >.

Gluttton avatar Nov 29 '13 21:11 Gluttton

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 specific Matrix 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?

Gluttton avatar Jan 08 '14 19:01 Gluttton

Maybe instead, modify Matrix to copy in and out of other implementations' instances?

saebyn avatar Jan 09 '14 15:01 saebyn

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)!

Gluttton avatar Jan 09 '14 16:01 Gluttton

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.

saebyn avatar Jan 10 '14 14:01 saebyn

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.

Gluttton avatar Apr 03 '16 13:04 Gluttton