require(igraph)
require(Matrix)
n = 1000
m = 100
R = n/m
K = 5
mvecr = m*rep(1/K,K)
rho = mvecr/sum(mvecr)
p = 0.01
eps=0
B <- mlist <- rholist <- NULL
for (i in 1:(n/m)) {
mlist[[i]] <- m ## m & rho can be different for each i
rholist[[i]] <- rho
B[[i]] <- as.matrix(forceSymmetric(matrix(runif(K^2,0.5-eps,0.5+eps),K)))
}
g0 <- hsbm.game(n,mlist,rholist,B,p)
B <- as.matrix(forceSymmetric(matrix(runif(K^2,0.5-eps,0.5+eps),K)))
gA <- hsbm.game(n,m,rho,B,p)
A0 <- as.matrix(g0[])
AA <- as.matrix(gA[])
all(A0==AA)