Skip to content

Commit

Permalink
added drop = FALSE ton handle the case when Q = 1 in reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
jchiquet committed Apr 29, 2021
1 parent 42658e2 commit 8c50c3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/R6Class-BipartiteSBM_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ BipartiteSBM_fit <-
oCol <- order(private$pi[[1]] %*% private$theta$mean, decreasing = TRUE)
private$pi[[1]] <- private$pi[[1]][oRow]
private$pi[[2]] <- private$pi[[2]][oCol]
private$theta$mean <- private$theta$mean[oRow, oCol]
private$theta$mean <- private$theta$mean[oRow, oCol, drop = FALSE]
private$Z[[1]] <- private$Z[[1]][, oRow, drop = FALSE]
private$Z[[2]] <- private$Z[[2]][, oCol, drop = FALSE]
},
Expand Down
2 changes: 1 addition & 1 deletion R/R6Class-SimpleSBM_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ SimpleSBM_fit <-
reorder = function(){
o <- order(private$theta$mean %*% private$pi, decreasing = TRUE)
private$pi <- private$pi[o]
private$theta$mean <- private$theta$mean[o,o]
private$theta$mean <- private$theta$mean[o, o, drop = FALSE]
private$Z <- private$Z[, o, drop = FALSE]
},
#--------------------------------------------
Expand Down

0 comments on commit 8c50c3c

Please sign in to comment.