COIN-OR::LEMON - Graph Library

Changeset 905:5be029d19c98 in lemon-0.x for src/hugo/smart_graph.h


Ignore:
Timestamp:
09/23/04 16:40:45 (16 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1215
Message:

Some code cleaning in id related stuffs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/smart_graph.h

    r904 r905  
    218218      template <typename T> friend class EdgeMap;
    219219
    220       //template <typename T> friend class SymSmartGraph::SymEdgeMap;     
    221       //friend Edge SymSmartGraph::opposite(Edge) const;
     220      friend class SymSmartGraph;
    222221     
    223222      friend class Node;
     
    226225      int n;
    227226      friend int SmartGraph::id(Edge e);
    228 
     227      Edge(int nn) {n=nn;}
    229228    public:
    230229      /// An Edge with id \c n.
    231230
    232       /// \bug It should be
    233       /// obtained by a member function of the Graph.
    234       Edge(int nn) {n=nn;}
    235231      Edge() { }
    236232      Edge (Invalid) { n=-1; }
     
    238234      bool operator!=(const Edge i) const {return n!=i.n;}
    239235      bool operator<(const Edge i) const {return n<i.n;}
    240       ///\bug This is a workaround until somebody tells me how to
    241       ///make class \c SymSmartGraph::SymEdgeMap friend of Edge
    242       int &idref() {return n;}
    243       const int &idref() const {return n;}
    244236//       ///Validity check
    245237//       operator bool() { return n!=-1; }
     238
     239      ///Set the edge to that have ID \c ID.
     240      void setToId(int id) { n=id; }
    246241   };
    247242   
     
    254249      EdgeIt (Invalid i) : Edge(i) { }
    255250      EdgeIt() : Edge() { }
    256       ///\bug This is a workaround until somebody tells me how to
    257       ///make class \c SymSmartGraph::SymEdgeMap friend of Edge
    258       int &idref() {return n;}
    259251      EdgeIt &operator++() { --n; return *this; }
    260252//       ///Validity check
     
    343335    {
    344336      Edge f;
    345       f.idref() = e.idref() - 2*(e.idref()%2) + 1;
     337      f.n = e.n - 2*(e.n%2) + 1;
    346338      return f;
    347339    }
Note: See TracChangeset for help on using the changeset viewer.