COIN-OR::LEMON - Graph Library

Changeset 606:c5fd2d996909 in lemon for lemon/euler.h


Ignore:
Timestamp:
03/29/09 23:08:20 (10 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Various doc improvements (#248)

  • Rename all the ugly template parameters (too long and/or starting with an underscore).
  • Rename function parameters starting with an underscore.
  • Extend the doc for many classes.
  • Use LaTeX-style O(...) expressions only for the complicated ones.
  • A lot of small unification changes.
  • Small fixes.
  • Some other improvements.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/euler.h

    r569 r606  
    5555  ///If \c g is not Euler then the resulted tour will not be full or closed.
    5656  ///\sa EulerIt
    57   template<class Digraph>
     57  template<typename GR>
    5858  class DiEulerIt
    5959  {
    60     typedef typename Digraph::Node Node;
    61     typedef typename Digraph::NodeIt NodeIt;
    62     typedef typename Digraph::Arc Arc;
    63     typedef typename Digraph::ArcIt ArcIt;
    64     typedef typename Digraph::OutArcIt OutArcIt;
    65     typedef typename Digraph::InArcIt InArcIt;
    66 
    67     const Digraph &g;
    68     typename Digraph::template NodeMap<OutArcIt> nedge;
     60    typedef typename GR::Node Node;
     61    typedef typename GR::NodeIt NodeIt;
     62    typedef typename GR::Arc Arc;
     63    typedef typename GR::ArcIt ArcIt;
     64    typedef typename GR::OutArcIt OutArcIt;
     65    typedef typename GR::InArcIt InArcIt;
     66
     67    const GR &g;
     68    typename GR::template NodeMap<OutArcIt> nedge;
    6969    std::list<Arc> euler;
    7070
     
    7373    ///Constructor
    7474
    75     ///\param _g A digraph.
     75    ///\param gr A digraph.
    7676    ///\param start The starting point of the tour. If it is not given
    7777    ///       the tour will start from the first node.
    78     DiEulerIt(const Digraph &_g,typename Digraph::Node start=INVALID)
    79       : g(_g), nedge(g)
     78    DiEulerIt(const GR &gr, typename GR::Node start = INVALID)
     79      : g(gr), nedge(g)
    8080    {
    8181      if(start==INVALID) start=NodeIt(g);
     
    146146  ///If \c g is not Euler then the resulted tour will not be full or closed.
    147147  ///\sa EulerIt
    148   template<class Digraph>
     148  template<typename GR>
    149149  class EulerIt
    150150  {
    151     typedef typename Digraph::Node Node;
    152     typedef typename Digraph::NodeIt NodeIt;
    153     typedef typename Digraph::Arc Arc;
    154     typedef typename Digraph::Edge Edge;
    155     typedef typename Digraph::ArcIt ArcIt;
    156     typedef typename Digraph::OutArcIt OutArcIt;
    157     typedef typename Digraph::InArcIt InArcIt;
    158 
    159     const Digraph &g;
    160     typename Digraph::template NodeMap<OutArcIt> nedge;
    161     typename Digraph::template EdgeMap<bool> visited;
     151    typedef typename GR::Node Node;
     152    typedef typename GR::NodeIt NodeIt;
     153    typedef typename GR::Arc Arc;
     154    typedef typename GR::Edge Edge;
     155    typedef typename GR::ArcIt ArcIt;
     156    typedef typename GR::OutArcIt OutArcIt;
     157    typedef typename GR::InArcIt InArcIt;
     158
     159    const GR &g;
     160    typename GR::template NodeMap<OutArcIt> nedge;
     161    typename GR::template EdgeMap<bool> visited;
    162162    std::list<Arc> euler;
    163163
     
    166166    ///Constructor
    167167
    168     ///\param _g An graph.
     168    ///\param gr An graph.
    169169    ///\param start The starting point of the tour. If it is not given
    170170    ///       the tour will start from the first node.
    171     EulerIt(const Digraph &_g,typename Digraph::Node start=INVALID)
    172       : g(_g), nedge(g), visited(g,false)
     171    EulerIt(const GR &gr, typename GR::Node start = INVALID)
     172      : g(gr), nedge(g), visited(g, false)
    173173    {
    174174      if(start==INVALID) start=NodeIt(g);
     
    239239  ///for each node. <em>Therefore, there are digraphs which are not Eulerian,
    240240  ///but still have an Euler tour</em>.
    241   template<class Digraph>
     241  template<typename GR>
    242242#ifdef DOXYGEN
    243243  bool
    244244#else
    245   typename enable_if<UndirectedTagIndicator<Digraph>,bool>::type
    246   eulerian(const Digraph &g)
    247   {
    248     for(typename Digraph::NodeIt n(g);n!=INVALID;++n)
     245  typename enable_if<UndirectedTagIndicator<GR>,bool>::type
     246  eulerian(const GR &g)
     247  {
     248    for(typename GR::NodeIt n(g);n!=INVALID;++n)
    249249      if(countIncEdges(g,n)%2) return false;
    250250    return connected(g);
    251251  }
    252   template<class Digraph>
    253   typename disable_if<UndirectedTagIndicator<Digraph>,bool>::type
     252  template<class GR>
     253  typename disable_if<UndirectedTagIndicator<GR>,bool>::type
    254254#endif
    255   eulerian(const Digraph &g)
    256   {
    257     for(typename Digraph::NodeIt n(g);n!=INVALID;++n)
     255  eulerian(const GR &g)
     256  {
     257    for(typename GR::NodeIt n(g);n!=INVALID;++n)
    258258      if(countInArcs(g,n)!=countOutArcs(g,n)) return false;
    259     return connected(Undirector<const Digraph>(g));
     259    return connected(Undirector<const GR>(g));
    260260  }
    261261
Note: See TracChangeset for help on using the changeset viewer.