COIN-OR::LEMON - Graph Library

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


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

towards on ListGraph?, SmartGraph? compatibility

Location:
src/work/alpar
Files:
2 edited

Legend:

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

    r165 r174  
    1 // -*-mode: c++; -*-
     1// -*- c++ -*-
     2#ifndef EMPTYGRAPH_H
     3#define EMPTYGRAPH_H
    24
    35#include <invalid.h>
     
    3537      Node() {}   //FIXME
    3638      /// Initialize the iterator to be invalid
    37       Node(Invalid) {};
     39      Node(Invalid) {}
    3840      //Node(const Node &) {}
    3941      bool operator==(Node n) const { return true; } //FIXME
     
    4850      NodeIt() {} //FIXME
    4951      /// Initialize the iterator to be invalid
    50       NodeIt(Invalid) {};
     52      NodeIt(Invalid) {}
    5153      /// Sets the iterator to the first node of \c G.
    5254      NodeIt(const EmptyGraph &G) {}
     
    6264      Edge() {}   //FIXME
    6365      /// Initialize the iterator to be invalid
    64       Edge(Invalid) {};
     66      Edge(Invalid) {}
    6567      //Edge(const Edge &) {}
    6668      bool operator==(Edge n) const { return true; } //FIXME
     
    7678      OutEdgeIt() {}
    7779      /// Initialize the iterator to be invalid
    78       OutEdgeIt(Invalid) {};
     80      OutEdgeIt(Invalid) {}
    7981      /// This constructor sets the iterator to first outgoing edge.
    8082   
     
    9294      InEdgeIt() {}
    9395      /// Initialize the iterator to be invalid
    94       InEdgeIt(Invalid) {};
     96      InEdgeIt(Invalid) {}
    9597      InEdgeIt(const EmptyGraph &, Node) {}   
    9698    };
     
    102104      EdgeIt() {}
    103105      /// Initialize the iterator to be invalid
    104       EdgeIt(Invalid) {};
     106      EdgeIt(Invalid) {}
    105107      EdgeIt(const EmptyGraph &) {}
    106108    };
     
    150152
    151153    /// Checks if a node iterator is valid
    152     bool valid(const Node) const { return true;};
     154    bool valid(const Node) const { return true;}
    153155    /// Checks if an edge iterator is valid
    154     bool valid(const Edge) const { return true;};
     156    bool valid(const Edge) const { return true;}
    155157
    156158    ///Gives back the \e id of a node.
    157     int id(const Node) const { return 0;};
     159    int id(const Node) const { return 0;}
    158160    ///Gives back the \e id of an edge.
    159     int id(const Edge) const { return 0;};
     161    int id(const Edge) const { return 0;}
    160162
    161163    //void setInvalid(Node &) const {};
     
    173175    int edgeNum() { return 0;}
    174176
    175     EmptyGraph() {};
    176     EmptyGraph(const EmptyGraph &G) {};
     177    EmptyGraph() {}
     178    EmptyGraph(const EmptyGraph &G) {}
    177179 
    178180 
     
    218220  // @}
    219221
    220 };
     222} //namespace hugo
    221223
    222224
     
    237239
    238240// }
     241
     242#endif // EMPTYGRAPH_H
  • 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.