COIN-OR::LEMON - Graph Library

Changeset 1106:0a7d604a9763 in lemon-0.x for src/lemon


Ignore:
Timestamp:
01/28/05 16:37:08 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1505
Message:

Concept modification to resolve the item by its ID.

Location:
src/lemon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/concept/graph_component.h

    r1043 r1106  
    298298      int id(const Node&) const { return -1;}
    299299
     300      /// \brief Gives back the node by the unique id.
     301      ///
     302      /// Gives back the node by the unique id.
     303      /// If the graph does not contain node with the given id
     304      /// then the result of the function is undetermined.
     305      Node fromId(int id, Node) const { return INVALID;}
     306
     307      /// \brief Gives back an unique integer id for the Edge.
     308      ///
    300309      /// Gives back an unique integer id for the Edge.
    301 
    302       /// Gives back an unique integer id for the Edge.
    303310      ///
    304311      int id(const Edge&) const { return -1;}
     312
     313      /// \brief Gives back the edge by the unique id.
     314      ///
     315      /// Gives back the edge by the unique id.
     316      /// If the graph does not contain edge with the given id
     317      /// then the result of the function is undetermined.
     318      Edge fromId(int id, Edge) const { return INVALID;}
    305319
    306320      template <typename _Graph>
     
    312326          int nid = graph.id(node);
    313327          nid = graph.id(node);
     328          node = graph.fromId(nid, Node());
    314329          typename _Graph::Edge edge;
    315330          int eid = graph.id(edge);
    316331          eid = graph.id(edge);
     332          edge = graph.fromId(eid, Edge());
    317333        }
    318334
  • src/lemon/full_graph.h

    r1039 r1106  
    103103    static int id(Edge e) { return e.id; }
    104104
     105    static Node fromId(int id, Node) { return Node(id);}
     106   
     107    static Edge fromId(int id, Edge) { return Edge(id);}
     108
    105109    /// Finds an edge between two nodes.
    106110   
  • src/lemon/list_graph.h

    r1080 r1106  
    163163    static int id(Edge e) { return e.id; }
    164164
     165    static Node fromId(int id, Node) { return Node(id);}
     166    static Edge fromId(int id, Edge) { return Edge(id);}
     167
    165168    /// Adds a new node to the graph.
    166169
  • src/lemon/smart_graph.h

    r1082 r1106  
    122122    static int id(Edge e) { return e.n; }
    123123
     124    static Node fromId(int id, Node) { return Node(id);}
     125
     126    static Edge fromId(int id, Edge) { return Edge(id);}
     127
    124128    Node addNode() {
    125129      Node n; n.n=nodes.size();
Note: See TracChangeset for help on using the changeset viewer.