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
53788387
Commit
53788387
authored
Jan 02, 2012
by
Tiago Peixoto
Browse files
Fix runtime error eigenvector() when no weights are used
This fixes ticket
#84
parent
77ef683f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/graph/centrality/graph_eigenvector.cc
View file @
53788387
...
...
@@ -36,7 +36,7 @@ long double eigenvector(GraphInterface& g, boost::any w, boost::any c,
throw
ValueException
(
"vertex property must be of floating point"
" value type"
);
typedef
ConstantPropertyMap
<
int
,
GraphInterface
::
vertex
_t
>
weight_map_t
;
typedef
ConstantPropertyMap
<
int
,
GraphInterface
::
edge
_t
>
weight_map_t
;
typedef
mpl
::
push_back
<
writable_edge_scalar_properties
,
weight_map_t
>::
type
weight_props_t
;
...
...
@@ -49,7 +49,7 @@ long double eigenvector(GraphInterface& g, boost::any w, boost::any c,
(
get_eigenvector
(),
_1
,
g
.
GetVertexIndex
(),
g
.
GetEdgeIndex
(),
_2
,
_3
,
epsilon
,
max_iter
,
ref
(
eig
)),
w
ritable_edge_scalar_properties
(),
w
eight_props_t
(),
vertex_floating_properties
())(
w
,
c
);
return
eig
;
}
...
...
src/graph/centrality/graph_eigenvector.hh
View file @
53788387
...
...
@@ -56,7 +56,7 @@ struct get_eigenvector
}
t_type
norm
=
0
;
t_type
delta
=
epsilon
+
1
;
size_t
iter
=
0
;
...
...
@@ -118,7 +118,7 @@ struct get_eigenvector
c
[
v
]
=
c_temp
[
v
];
}
}
eig
=
1.
/
norm
;
}
};
...
...
src/graph_tool/centrality/__init__.py
View file @
53788387
...
...
@@ -364,7 +364,7 @@ def eigenvector(g, weight=None, vprop=None, epsilon=1e-6, max_iter=None):
----------
g : :class:`~graph_tool.Graph`
Graph to be used.
weight
s
: :class:`~graph_tool.PropertyMap` (optional, default: ``None``)
weight : :class:`~graph_tool.PropertyMap` (optional, default: ``None``)
Edge property map with the edge weights.
vprop : :class:`~graph_tool.PropertyMap`, optional (default: ``None``)
Vertex property map where the values of eigenvector must be stored.
...
...
Write
Preview
Supports
Markdown
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