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
d7e364cf
Commit
d7e364cf
authored
Apr 10, 2012
by
Tiago Peixoto
Browse files
Fix bug with non-integer weights in modularity()
parent
e13b4d44
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/community/graph_community.hh
View file @
d7e364cf
...
...
@@ -502,6 +502,7 @@ struct get_modularity
double
&
modularity
)
const
{
typedef
typename
property_traits
<
WeightMap
>::
key_type
weight_key_t
;
typedef
typename
property_traits
<
WeightMap
>::
value_type
weight_val_t
;
typedef
typename
property_traits
<
CommunityMap
>::
value_type
s_val_t
;
modularity
=
0.0
;
...
...
@@ -516,7 +517,7 @@ struct get_modularity
modularity
+=
2
*
get
(
weights
,
weight_key_t
(
*
e
));
}
unordered_map
<
s_val_t
,
size
_t
>
Ks
;
unordered_map
<
s_val_t
,
weight_val
_t
>
Ks
;
typename
graph_traits
<
Graph
>::
vertex_iterator
v
,
v_end
;
for
(
tie
(
v
,
v_end
)
=
vertices
(
g
);
v
!=
v_end
;
++
v
)
...
...
Tiago Peixoto
@count0
mentioned in issue
#77 (closed)
·
Aug 06, 2014
mentioned in issue
#77 (closed)
mentioned in issue #77
Toggle commit list
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