Skip to content

Commit

Permalink
removed row first order and fixed erroneous test
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics committed Jan 15, 2025
1 parent 65711b0 commit 19a52b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion R/incidence.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ process.sparse <- function(incidence, num_rows) {
# Helper function to process dense matrices (matrix to edgelist)
process.dense <- function(incidence, num_rows) {
nz_ids <- which(incidence != 0, arr.ind = TRUE)
nz_ids <- nz_ids[order(nz_ids[, 1], nz_ids[, 2]), , drop = FALSE]
el <- cbind(nz_ids, incidence[nz_ids])
el[, 2] <- el[, 2] + num_rows
el
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/incidence.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
IGRAPH UNWB 8 7 --
+ attr: type (v/l), name (v/c), weight (e/n)
+ edges (vertex names):
[1] A--c A--d B--b B--c B--e C--b C--d
[1] B--b C--b A--c B--c A--d C--d B--e

# graph_from_biadjacency_matrix() works -- dense + multiple

Expand Down

0 comments on commit 19a52b0

Please sign in to comment.