Skip to content
Aapo Kyrola edited this page Nov 4, 2013 · 3 revisions

Vertex aggregators help analyzing the vertex data.

Here is simple example how to output value of each vertex:

template <typename VertexDataType>
    class MyCallback {
    public:
        void callback(vid_t vertex_id, VertexDataType &value) {
            std::cout << vertex_id << ", " << value << std::endl;
        }
    };
    

foreach_vertices(filename, 0, engine.num_vertices(), MyCallback<VertexDataType>());

You can use the callback for all kind of aggregation methods such as computing sum of vertex values (see sum_vertices()).