graph.cpp

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00002 
00028 #include "graph.h"
00029 
00035 void hugin_utils::findSubGraphs(AdjListGraph & graph,
00036                           std::vector<int> & subgraphStart)
00037 {
00038     int nImages = (int) graph.size();
00039     // nodes that have not been visited
00040     std::set<int> unseen;
00041     // fill with all images
00042     for (int i=0; i<nImages; i++) unseen.insert(i);
00043 
00044     while(!unseen.empty()) {
00045         // first remaining node determines the next graph
00046         int root = (int) *(unseen.begin());
00047         subgraphStart.push_back(root);
00048         // visit all nodes of this subgraph
00049         RemoveVisitor rmv(unseen);
00050         traverseVertices(graph, root, rmv);
00051     }
00052 }

Generated on 27 Mar 2016 for Hugintrunk by  doxygen 1.4.7