Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
9f538563
Commit
9f538563
authored
May 22, 2022
by
Tiago Peixoto
Browse files
BlockState: improve initialization of array-valued parameter `b`
parent
1d8167da
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/inference/blockmodel.py
View file @
9f538563
...
...
@@ -254,7 +254,9 @@ class BlockState(MCMCState, MultiflipMCMCState, MultilevelMCMCState,
# if a partition is available, we will incorporate it.
if
isinstance
(
b
,
numpy
.
ndarray
):
self
.
b
=
g
.
new_vp
(
"int"
)
self
.
b
.
fa
=
b
ba
=
numpy
.
zeros
(
len
(
self
.
b
.
fa
),
dtype
=
"int"
)
ba
[:
min
(
len
(
ba
),
len
(
b
))]
=
b
[:
min
(
len
(
ba
),
len
(
b
))]
self
.
b
.
fa
=
ba
else
:
self
.
b
=
b
=
g
.
own_property
(
b
.
copy
(
value_type
=
"int32_t"
))
if
B
is
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment