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
cfb7809f
Commit
cfb7809f
authored
Apr 28, 2014
by
Tiago Peixoto
Browse files
Fix transition() matrix for weighted graphs
parent
0fa8cbfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/spectral/graph_transition.hh
View file @
cfb7809f
...
@@ -56,16 +56,14 @@ struct get_transition
...
@@ -56,16 +56,14 @@ struct get_transition
multi_array_ref
<
int32_t
,
1
>&
j
)
const
multi_array_ref
<
int32_t
,
1
>&
j
)
const
{
{
int
pos
=
0
;
int
pos
=
0
;
typename
graph_traits
<
Graph
>::
vertex_iterator
v
,
v_end
;
for
(
auto
v
:
vertices_range
(
g
))
for
(
tie
(
v
,
v_end
)
=
vertices
(
g
);
v
!=
v_end
;
++
v
)
{
{
double
k
=
sum_degree
(
g
,
*
v
,
weight
,
out_edge_iteratorS
<
Graph
>
());
double
k
=
sum_degree
(
g
,
v
,
weight
,
out_edge_iteratorS
<
Graph
>
());
typename
graph_traits
<
Graph
>::
out_edge_iterator
e
,
e_end
;
for
(
auto
e
:
out_edges_range
(
v
,
g
))
for
(
tie
(
e
,
e_end
)
=
out_edges
(
*
v
,
g
);
e
!=
e_end
;
++
e
)
{
{
data
[
pos
]
=
1.
/
k
;
data
[
pos
]
=
weight
[
e
]
/
k
;
i
[
pos
]
=
get
(
index
,
source
(
*
e
,
g
));
i
[
pos
]
=
get
(
index
,
source
(
e
,
g
));
j
[
pos
]
=
get
(
index
,
target
(
*
e
,
g
));
j
[
pos
]
=
get
(
index
,
target
(
e
,
g
));
++
pos
;
++
pos
;
}
}
}
}
...
...
Tiago Peixoto
@count0
mentioned in issue
#145 (closed)
·
Aug 06, 2014
mentioned in issue
#145 (closed)
mentioned in issue #145
Toggle commit list
Tiago Peixoto
@count0
mentioned in issue
#145 (closed)
·
Aug 06, 2014
mentioned in issue
#145 (closed)
mentioned in issue #145
Toggle commit list
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