-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
refactor: consolidate graph.incidence.* (#1483) #1654
base: main
Are you sure you want to change the base?
Conversation
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
|
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.
Thanks. Overall, the code doesn't seem to be well-prepared for the edge case of one-row matrices, we might need drop = TRUE
in several places.
Could we perhaps forward to graph.incidence.sparse()
in this case, perhaps even change graph.incidence.sparse()
to accept both sparse and dense matrices? A lot of code there looks similar to what we have here.
Yes I now realize that I borrowed the logic from the sparse function and simply adapted where needed for the dense case. Thats not optimal. I think I can refactor both |
The logic is now completely rewritten. There are no dedicated |
@schochastics I haven't been able to follow what's going on with the "incidence" (bipartite adjacency) matrix work, as I'm overwhelmed with other work at the moment. Do you think it would be good to have a short video meeting to discuss how the C library handled bipartite incidence matrices, so that when the R package finally starts using this functionality, the behaviour wouldn't change? I.e., just make sure that whatever's implemented in pure R now matches the C behaviour. |
@szhorvat Happy to do so. I sent you an email |
This PR can be reviewed now |
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.
Thanks, this might need yet another iteration or two.
@krlmlr ready to be reviewed again |
This PR removes (nested) for loops forgraph.incidence.dense()
whenweighted = TRUE
(cherry picked commits from #1518)This PR removes
graph.incidence.sparse()
andgraph.incidence.dense()
and replaces it with a generalgraph.incidence.build()
and more specialized helper functions.