Boost logo

Boost Users :

From: Tom Lenaerts (tlenaert_at_[hidden])
Date: 2006-09-18 16:08:09


This is again a newbie question.

I want to create a graph based on some input file. I parse this file
and in the code I want to check whether the link already exists

                int current=strToInt(tokens[0]);
                int numedges=strToInt(tokens[1]);
                for(int i=0;i<numedges;i++){
                        Vertex first=vertex(current,*g);
                        int other=strToInt(tokens[3+i]);
                        Vertex second=vertex(other,*g);
                        pair<Edge, bool> result=boost::edge(first,second,*g);
                        if(!result.second){
                                boost::add_edge(first,second,*g);
                        }
                }

tokens[0] is the id of the node, tokens[1] contains the number of
edges this node is pointing to. From tokens[3] until the end, one
gets the nodes to which the current node is connected (stored in other)
As you can see I call the function boost::edge() to check whether
there is already a link between first and second. As soon as I do
this I get an error in Xcode.

Does anyone know what I'm doing wrong here. It probably something
very simple but I don't see it.

Thanks in advance

Tom



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