Skip to content

Commit eab961a

Browse files
authored
Merge branch 'master' into meyer/lscsr-perf
2 parents fc2d84c + 0406b2e commit eab961a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

libgalois/include/galois/graphs/LS_LC_CSR_Graph.h

+14
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,20 @@ class LS_LC_CSR_Graph : private boost::noncopyable {
259259
}
260260
}
261261

262+
/*
263+
* Iterates over the outgoing edges, calling the callback with the
264+
* VertexTopologyID of each edge.
265+
*/
266+
template <typename Callback>
267+
void for_each_edge(VertexTopologyID vertex, Callback const& callback) {
268+
auto const& vertex_meta = m_vertices[vertex];
269+
EdgeMetadata const* begin =
270+
&getEdgeMetadata(vertex_meta.buffer, vertex_meta.begin);
271+
for (uint64_t i = 0; i < vertex_meta.degree(); ++i) {
272+
callback(static_cast<VertexTopologyID>(*begin++));
273+
}
274+
}
275+
262276
/*
263277
* Sort the outgoing edges for the given vertex.
264278
*/

0 commit comments

Comments
 (0)