-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation reverse Cuthill-McKee #186
Conversation
That looks nice, thanks. First remarks:
I'll take more time to review the rest a bit later. |
My bad, looks like CI did pass https://travis-ci.org/github/vbarrielle/sprs/builds/668095347, I don't know why github did not display it... |
I am wondering why CI was not displayed as well, but I can't help you there, I am not that good with Github.
Take your time to review, though the tests seem to pass I am not sure if I got all the library-specifics absolutely correct. |
Don't worry about the CI, maybe it's simply an issue with github. The main reason why I wanted to expose In that spirit, I think it's a idea to expose the Don't worry about the comments line width, I'll fix them myself later on, and I'll try and find the proper rustmf configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm done reviewing. I've really appreciated reading your code, the style is very clear and well commented. I mentionned a few places where I'd like to see extra clarifications.
I haven't read the paper on the algorithm you've implemented for the pseudoperipheral vertex, so I'll trust you on that one for the moment, but everything looks reasonable in the implementation.
Thanks a lot for doing this!
I will push the requested changes now. After giving it some more thought, I believe the best compromise between ease of use and customizability is: exposing one function generic over the orderings direction and the starting strategy, |
I agree exposing two functions is the best way to enable choosing the init strategy while encouraging pseudoperipheral as a default. |
Here is the refactored, extended version. Concerning the namespacing, that definitely needs to be overhauled. I introduced the modules Please comment what you would like to be clarfied etc., and if you believe there need to be more test cases covering all the different options, although most are quite trivial. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though the trait abstraction makes the code a little harder to follow, I agree with the motivation for monomorphization. Your comments are to the point and make the implementation quite readable.
In addition to the points I mentionned in my review comments, I think it could be nice to show an example of custom re-ordering in the fill_in_reduction.rs
example. That way we can see if the module structure feels ergonomic.
After this I think it will be ready to be merged.
I have implemented all changes as requested. If there is nothing left to discuss, this can now be merged. |
That's perfect, I'm merging. |
ANd thanks a lot! |
It's the magic of open source! |
See also #185 .
This changes the Cuthill-McKee algorithm implemented here to the reverse Cuthill-McKee algorithm. Starting vertices are choosen by a George-Liu pseudoperipheral vertex finder.
I have added two more test cases and verified the correctness of the exisiting one w.r.t. the new algorithm.
I did try to write in the style of the library, however I might not always have got it right when to use
.index()
, when to call.unwrap()
vs.expect()
, and so on. Feel free to change these details, as well as remove unneccesary comments or line breaks. I just can't get enough of those.As benchmark possibilities are scarce, I did not optimize anything to aggressively. I really believe this crate should come with some sparse matrix collection as well as random matrices to benchmark against, automatically. That would make tweaking the details worthwile. That's an issue for another time though.
Concerning the minimum degree ordering: As it is significantly more complex, It will take some more time to implement it, as in a few days to weeks. I will do it eventually, but I don't want to block somebody else on it, if there is interest.