Commit 1a49d458 authored by Tiago Peixoto's avatar Tiago Peixoto

Fix bug in CovariateBlockState.merge_layers() with non-overlapping groups

parent c72bb4c0
...@@ -239,9 +239,11 @@ class CovariateBlockState(BlockState): ...@@ -239,9 +239,11 @@ class CovariateBlockState(BlockState):
nt = 1 nt = 1
if openmp_enabled(): if openmp_enabled():
nt = openmp_get_num_threads() nt = openmp_get_num_threads()
B = u.num_vertices() + 2 * nt
B = max(B, u.vp["b"].a.max() + 1 + 2 * nt)
if not self.overlap: if not self.overlap:
state = BlockState(u, b=u.vp["b"], state = BlockState(u, b=u.vp["b"],
B=u.num_vertices() + 2 * nt, B=B,
eweight=u.ep["weight"], eweight=u.ep["weight"],
vweight=u.vp["weight"], vweight=u.vp["weight"],
deg_corr=self.deg_corr, deg_corr=self.deg_corr,
...@@ -249,8 +251,6 @@ class CovariateBlockState(BlockState): ...@@ -249,8 +251,6 @@ class CovariateBlockState(BlockState):
max_BE=self.max_BE) max_BE=self.max_BE)
else: else:
base_u, node_index = self.__get_base_u(u) base_u, node_index = self.__get_base_u(u)
B = u.num_vertices() + 2 * nt
B = max(B, u.vp["b"].a.max() + 1 + 2 * nt)
state = OverlapBlockState(u, b=u.vp["b"].a, state = OverlapBlockState(u, b=u.vp["b"].a,
B=B, B=B,
vweight=u.vp["weight"], vweight=u.vp["weight"],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment