graph.cpp

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

Generated on 5 Dec 2014 for Hugintrunk by  doxygen 1.4.7