OKlibrary  0.2.1.6
Auxiliary.hpp
Go to the documentation of this file.
00001 // Oliver Kullmann, 18.8.2003 (Swansea)
00002 /* Copyright 2003 - 2007 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00008 #ifndef AUXILIARYWAECHTER
00009 
00010 #define AUXILIARYWAECHTER
00011 
00012 #include <iostream>
00013 
00014 #include <boost/graph/graph_traits.hpp>
00015 
00016 namespace Auxiliary {
00017 
00018   // \cite{LLS2001BGL}, page 6
00019   template <class Graph>
00020   bool is_self_loop(typename boost::graph_traits<Graph>::edge_descriptor e, const Graph& g) {
00021     typename boost::graph_traits<Graph>::vertex_descriptor u, v;
00022     u = source(e, g);
00023     v = target(e, g);
00024     return u == v;
00025   }
00026 
00027   // \cite{LLS2001BGL}, page 6
00028   template <class VertexDescriptor, class VertexNameMap>
00029   void print_vertex_name(VertexDescriptor v, VertexNameMap name_map) {
00030     std::cout << get(name_map, v);
00031   }
00032 
00033   // \cite{LLS2001BGL}, page 6
00034   template <class Graph, class TransDelayMap, class VertexNameMap>
00035   void print_trans_delay(typename boost::graph_traits<Graph>::edge_descriptor e, const Graph& g, TransDelayMap delay_map, VertexNameMap name_map) {
00036     std::cout << "trans-delay(" << get(name_map, source(e,g)) << "," << get(name_map, target(e,g)) << ") = " << get(delay_map, e);
00037   }
00038 
00039 }
00040 
00041 #endif