Skip to content

Commit 19c5abe

Browse files
Fixed as.edgeList.SparseBLockMatrixR for consistency with sparsebnUtils, edgeList changes
1 parent cebeda0 commit 19c5abe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

R/s3-SparseBlockMatrixR.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@ as.matrix.SparseBlockMatrixR <- function(x){
261261
} # END AS.MATRIX.SPARSEBLOCKMATRIXR
262262

263263
#------------------------------------------------------------------------------#
264-
# as.edgeList.SparseBlockMatrixR
264+
# edgeList.SparseBlockMatrixR
265265
# Coerce SBM to edge list
266266
#
267-
as.edgeList.SparseBlockMatrixR <- function(x){
267+
edgeList.SparseBlockMatrixR <- function(x){
268268
#
269269
# We have to be careful in obtaining the edge list of a SparseBlockMatrixR object:
270270
# It is NOT the same as the rows slot since some of these components may have
@@ -278,7 +278,7 @@ as.edgeList.SparseBlockMatrixR <- function(x){
278278
el <- mapply(function(x, y){ y[which(abs(x) > sparsebnUtils::zero_threshold())]}, x$vals, x$rows)
279279

280280
sparsebnUtils::edgeList(el)
281-
} # AS.EDGELIST.SPARSEBLOCKMATRIXR
281+
} # EDGELIST.SPARSEBLOCKMATRIXR
282282

283283
#------------------------------------------------------------------------------#
284284
# sparse.SparseBlockMatrixR
@@ -347,7 +347,7 @@ to_graphNEL.SparseBlockMatrixR <- function(x){
347347
} # END TO_GRAPHNEL.SPARSEBLOCKMATRIXR
348348

349349
get.adjacency.matrix.SparseBlockMatrixR <- function(x){
350-
sparsebnUtils::get.adjacency.matrix(as.edgeList.SparseBlockMatrixR(x))
350+
sparsebnUtils::get.adjacency.matrix(as.edgeList(x))
351351
} # END GET.ADJACENCY.MATRIX.SPARSEBLOCKMATRIXR
352352

353353
num.nodes.SparseBlockMatrixR <- function(x){
@@ -357,7 +357,7 @@ num.nodes.SparseBlockMatrixR <- function(x){
357357

358358
num.edges.SparseBlockMatrixR <- function(x){
359359
### The number of nodes should be exactly the same as the length of the rows list
360-
sparsebnUtils::num.edges(as.edgeList.SparseBlockMatrixR(x))
360+
sparsebnUtils::num.edges(as.edgeList(x))
361361
} # END NUM.EDGES.SPARSEBLOCKMATRIXR
362362

363363
# This function is (so far) only used in unit tests

0 commit comments

Comments
 (0)