Boost logo

Boost Users :

From: Olivier Tournaire (olitour_at_[hidden])
Date: 2007-11-12 17:05:23


Hi all,

i'm trying to clear an adjacency_list. I do the following, as described in
the documentation :

void MPPRectangleGraph::Clear(unsigned int flags)
{
    bool erase_nodes = false, erase_edges = false, erase_all = false;
    if ( flags&GraphErase::eERASE_ALL )
        erase_all = true;
    else
    {
        if ( flags&GraphErase::eERASE_NODES )
            erase_nodes = true;
        if ( flags&GraphErase::eERASE_EDGES )
            erase_edges = true;
    }
    if ( erase_nodes || erase_all )
    {
        std::cout << "begin" << std::endl;
        MPPRectangleGraph::vertex_iterator vi, vi_end, next;
        boost::tie(vi, vi_end) = vertices(*this);
        unsigned int i=0;
        std::cout << num_vertices(*this) << std::endl;
        //clear_vertex(*vi, *this);
        //remove_vertex(*vi, *this);
        for (next = vi; vi != vi_end; vi = next)
        {
            std::cout << i++ << std::endl;
            ++next;
            clear_vertex(*vi, *this);
            remove_vertex(*vi, *this);
        }
    }
    std::cout << "end" << std::endl;
}

The MPPRectangleGraph is simply derived from adjacency_list. Containers are
boost:vecS for both vertices and edges. When I have 100 vertices in my
graph, I catch an unhandeld exception with catch(...) ("i" is printed only
unitl 50), and, when my graph contains only 3 nodes, a std::exception is
catched with this message : "vector<T> too long".
Can you help ?

Regards.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net