Boost logo

Boost Users :

From: bernhard lippmann (lippmann2_at_[hidden])
Date: 2008-05-01 16:27:18


Hi Aaron

your guess is correct, my code tis rying to add int values to the graph.

is it a bad idea to use typedef std::pair <int, int> TEdge;
for add_edge(...) to a graph, below is my relevant source code snippet.

Best

Bernhard

--------------------------------------------------------------------------

    iter = this->Elements.begin();
         while(iter != this->Elements.end())
             {
             aAtomicElement = (*iter).second;

                 for (str_iter=aAtomicElement.AE_PinList.begin(); str_iter!= aAtomicElement.AE_PinList.end(); ++str_iter)
                   for (str_iter2=str_iter+1; str_iter2!= aAtomicElement.AE_PinList.end(); ++str_iter2)
                                          {
                               cout << "\n Params before call Add_edge(...) function \n ";
                                                           cout << "edge as [<std::string>]: "<< *str_iter << " ::" << *str_iter2 << " \n ";
                               cout << "edge as [<int> <int>] : "<< index_of_element( this->VertexNamesList, *str_iter) << " :: " << index_of_element( this->VertexNamesList, *str_iter2) << " \n ";
                                                           OneEdge.first = index_of_element( this->VertexNamesList, *str_iter);
                               OneEdge.second = index_of_element( this->VertexNamesList, *str_iter2);
                              
                              
                               tie(e, inserted) = add_edge(OneEdge.first, OneEdge.second, g);
                                   

                                                           if (inserted)
                                        {
                                         
                                    v = source(e, g);

                                                                        VertexNamesMap[v] = *str_iter;

                                    v = target(e, g);

                                                                        VertexNamesMap[v] = *str_iter2;
                                     
                                                                        EdgeNamesMap[e] = aAtomicElement.AE_Name;

                                                                        // EdgeIndexMap[e] = StrToInt(aAtomicElement.AE_ID);

                                                                        cout << " using Edge -->" << EdgeNamesMap[e] ;

                                                                        WeightMap[e] = 1 ;
                                                                }

                    }

                iter ++;
          } // while ...
             

        break;

-- 
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! 
http://games.entertainment.gmx.net/de/entertainment/games/free

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