Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tiago Peixoto
graph-tool
Commits
41d98f5c
Commit
41d98f5c
authored
Oct 29, 2016
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blockmodel: Fix minor issue with zero-weight edges
parent
65ea9489
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
src/graph/inference/graph_blockmodel.hh
src/graph/inference/graph_blockmodel.hh
+3
-0
src/graph/inference/graph_blockmodel_util.hh
src/graph/inference/graph_blockmodel_util.hh
+2
-1
No files found.
src/graph/inference/graph_blockmodel.hh
View file @
41d98f5c
...
...
@@ -209,6 +209,9 @@ public:
entries_op
(
_m_entries
,
_emat
,
[
&
](
auto
r
,
auto
s
,
auto
&
me
,
auto
&
delta
)
{
if
(
get
<
0
>
(
delta
)
==
0
)
// can happen with zero-weight
return
;
// edges
beop
(
false
,
me
);
if
(
Add
&&
me
==
this
->
_emat
.
get_null_edge
())
...
...
src/graph/inference/graph_blockmodel_util.hh
View file @
41d98f5c
...
...
@@ -1408,7 +1408,8 @@ public:
void
insert_edge
(
const
Edge
&
e
,
DynamicSampler
<
Edge
>&
elist
,
size_t
weight
,
size_t
&
pos
)
{
if
(
pos
<
elist
.
size
()
&&
elist
.
is_valid
(
pos
)
&&
elist
[
pos
]
==
e
)
if
((
pos
<
elist
.
size
()
&&
elist
.
is_valid
(
pos
)
&&
elist
[
pos
]
==
e
)
||
weight
==
0
)
return
;
assert
(
pos
>=
elist
.
size
()
||
!
elist
.
is_valid
(
pos
)
||
elist
[
pos
]
!=
e
);
pos
=
elist
.
insert
(
e
,
weight
);
...
...
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