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
d7e364cf
Commit
d7e364cf
authored
Apr 10, 2012
by
Tiago Peixoto
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug with non-integer weights in modularity()
parent
e13b4d44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/graph/community/graph_community.hh
src/graph/community/graph_community.hh
+2
-1
No files found.
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