refactor: consolidate graph.incidence.* (#1483)#1654
refactor: consolidate graph.incidence.* (#1483)#1654schochastics merged 13 commits intoigraph:mainfrom
Conversation
Current Aviator status
This PR was merged manually (without Aviator). Merging manually can negatively impact the performance of the queue. Consider using Aviator next time.
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.
|
|
|
krlmlr
left a comment
There was a problem hiding this comment.
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 |
krlmlr
left a comment
There was a problem hiding this comment.
Thanks, this might need yet another iteration or two.
|
@krlmlr ready to be reviewed again |
555922b to
412e6b3
Compare
|
Can you please tweak and auto-merge? |
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.