src/hugo/full_graph.h
changeset 813 65144c52969c
parent 798 6d1abeb62dd3
child 822 88226d9fe821
equal deleted inserted replaced
8:d9481ca78122 9:04cf0f47c201
    56     FullGraph(int n) : NodeNum(n), EdgeNum(NodeNum*NodeNum) { }
    56     FullGraph(int n) : NodeNum(n), EdgeNum(NodeNum*NodeNum) { }
    57     ///
    57     ///
    58     FullGraph(const FullGraph &_g)
    58     FullGraph(const FullGraph &_g)
    59       : NodeNum(_g.nodeNum()), EdgeNum(NodeNum*NodeNum) { }
    59       : NodeNum(_g.nodeNum()), EdgeNum(NodeNum*NodeNum) { }
    60     
    60     
    61     int nodeNum() const { return NodeNum; }  //FIXME: What is this?
    61     ///Number of nodes.
    62     int edgeNum() const { return EdgeNum; }  //FIXME: What is this?
    62     int nodeNum() const { return NodeNum; }
    63 
    63     ///Number of edges.
    64     int maxNodeId() const { return NodeNum; }  //FIXME: What is this?
    64     int edgeNum() const { return EdgeNum; }
    65     int maxEdgeId() const { return EdgeNum; }  //FIXME: What is this?
    65 
       
    66     /// Maximum node ID.
       
    67     
       
    68     /// Maximum node ID.
       
    69     ///\sa id(Node)
       
    70     int maxNodeId() const { return NodeNum-1; }
       
    71     /// Maximum edge ID.
       
    72     
       
    73     /// Maximum edge ID.
       
    74     ///\sa id(Edge)
       
    75     int maxEdgeId() const { return EdgeNum-1; }
    66 
    76 
    67     Node tail(Edge e) const { return e.n%NodeNum; }
    77     Node tail(Edge e) const { return e.n%NodeNum; }
    68     Node head(Edge e) const { return e.n/NodeNum; }
    78     Node head(Edge e) const { return e.n/NodeNum; }
    69 
    79 
    70     NodeIt& first(NodeIt& v) const {
    80     NodeIt& first(NodeIt& v) const {
    74     OutEdgeIt& first(OutEdgeIt& e, const Node v) const { 
    84     OutEdgeIt& first(OutEdgeIt& e, const Node v) const { 
    75       e=OutEdgeIt(*this,v); return e; }
    85       e=OutEdgeIt(*this,v); return e; }
    76     InEdgeIt& first(InEdgeIt& e, const Node v) const { 
    86     InEdgeIt& first(InEdgeIt& e, const Node v) const { 
    77       e=InEdgeIt(*this,v); return e; }
    87       e=InEdgeIt(*this,v); return e; }
    78 
    88 
       
    89     /// Node ID.
       
    90     
       
    91     /// The ID of a valid Node is a nonnegative integer not greater than
       
    92     /// \ref maxNodeId(). The range of the ID's is not surely continuous
       
    93     /// and the greatest node ID can be actually less then \ref maxNodeId().
       
    94     ///
       
    95     /// The ID of the \ref INVALID node is -1.
       
    96     ///\return The ID of the node \c v. 
    79     static int id(Node v) { return v.n; }
    97     static int id(Node v) { return v.n; }
       
    98     /// Edge ID.
       
    99     
       
   100     /// The ID of a valid Edge is a nonnegative integer not greater than
       
   101     /// \ref maxEdgeId(). The range of the ID's is not surely continuous
       
   102     /// and the greatest edge ID can be actually less then \ref maxEdgeId().
       
   103     ///
       
   104     /// The ID of the \ref INVALID edge is -1.
       
   105     ///\return The ID of the edge \c e. 
    80     static int id(Edge e) { return e.n; }
   106     static int id(Edge e) { return e.n; }
    81 
   107 
    82     /// Finds an edge between two nodes.
   108     /// Finds an edge between two nodes.
    83     
   109     
    84     /// Finds an edge from node \c u to node \c v.
   110     /// Finds an edge from node \c u to node \c v.