Skip to content

Conversation

@ms609
Copy link

@ms609 ms609 commented Apr 19, 2023

Thanks for this handy package.

It would be useful to add a sense check to avoid crashing R when a zero-length input is provided.

RcppHungarian::HungarianSolver(matrix(0, 0, 0)) # Crashes R

One alternative would be to return an error, but I've proposed returning a zero-length, zero-score matching.

I've not checked or tested the code proposed below, but hopefully it provides a useful starting point.

@jan-glx
Copy link

jan-glx commented Nov 22, 2023

Great! The second element of the returned list should be 2 column 0 row matrix though.

The second element of the returned list should be 2 column 0 row matrix
@ms609
Copy link
Author

ms609 commented Nov 23, 2023

I've updated the proposed code accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants