COIN-OR::LEMON - Graph Library

Changeset 174:44700ed9ffaa in lemon-0.x for src/work/alpar/smart_graph.h


Ignore:
Timestamp:
03/12/04 10:19:54 (18 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@250
Message:

towards on ListGraph?, SmartGraph? compatibility

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/alpar/smart_graph.h

    r164 r174  
    9797    Node head(Edge e) const { return edges[e.n].head; }
    9898
    99 //     Node aNode(const OutEdgeIt& e) const { return tail(e); }
    100 //     Node aNode(const InEdgeIt& e) const { return head(e); }
     99    // Marci
     100    Node aNode(OutEdgeIt e) const { return edges[e.n].tail; }
     101    Node aNode(InEdgeIt e) const { return edges[e.n].head; }
    101102//     //Node aNode(const SymEdge& e) const { return e.aNode(); }
    102103
    103 //     Node bNode(const OutEdgeIt& e) const { return head(e); }
    104 //     Node bNode(const InEdgeIt& e) const { return tail(e); }
     104    // Marci
     105    Node bNode(OutEdgeIt e) const { return edges[e.n].head; }
     106    Node bNode(InEdgeIt e) const { return edges[e.n].tail; }
    105107//     //Node bNode(const SymEdge& e) const { return e.bNode(); }
    106108
     
    117119    It first() const {
    118120      It e;
    119       getFirst(e);
     121      //Marci
     122      /*getF*/first(e);
    120123      return e;
    121124    }
     
    124127    It first(Node v) const {
    125128      It e;
    126       getFirst(e, v);
     129      //Marci
     130      /*getF*/first(e, v);
    127131      return e;
    128132    }
     
    139143    //{ It tmp; tmp.n=it.n+1; return tmp; }
    140144
    141     Node& next(Node& it) const { it.n=(it.n+2)%nodes.size()-1; return it; }
     145    //FIXME correction Marci: I changed to NodeIt from Node
     146    //NodeIt& next(NodeIt& it) const { it.n=(it.n+2)%nodes.size()-1; return it; }
     147    NodeIt& next(NodeIt& it) const {
     148      it.n=(it.n+2)%(nodes.size()+1)-1;
     149      return it;
     150    }
    142151    OutEdgeIt& next(OutEdgeIt& it) const
    143152    { it.n=edges[it.n].next_out; return it; }
     
    217226    public:
    218227      Edge() { }
    219       Edge (Invalid i) { n=-1; }
     228      // Marci: kiszedtem az Invalid i-bol az i-t
     229      Edge (Invalid) { n=-1; }
    220230      bool operator==(const Edge i) const {return n==i.n;}
    221231      bool operator!=(const Edge i) const {return n!=i.n;}
Note: See TracChangeset for help on using the changeset viewer.