Ejemplo n.º 1
0
Totals
sgl_time_edge_traversal()
{
    GraphType g;
    sgl_random_graph(g, MAX_VERTICES, 2, 4.0);
    size_t niter=0;
    start_deadman(2);
    Sawyer::Stopwatch t;
    while (!had_alarm && niter<MAX_COUNT) {
        boost::iterator_range<typename GraphType::EdgeNodeIterator> edges = g.edges();
        for (typename GraphType::EdgeNodeIterator edge=edges.begin(); edge!=edges.end() && !had_alarm; ++edge)
            ++niter;
    }
    t.stop();
    return report("edge iter", sgl_size(g), niter, t, "edges/s");
}
Ejemplo n.º 2
0
Totals
yagi_time_edge_traversal()
{
    GraphType g;
    yagi_random_graph(g, MAX_VERTICES, 2, 4.0);
    size_t niter=0;
    start_deadman(2);
    Sawyer::Stopwatch t;
    while (!had_alarm && niter<MAX_COUNT) {
        typename GraphType::EdgeIterator ei, ei_end;
        for (boost::tie(ei, ei_end) = g.edges(); ei!=ei_end && !had_alarm; ++ei)
            ++niter;
    }
    t.stop();
    return report("edge iter", yagi_size(g), niter, t, "edges/s");
}