COIN-OR::LEMON - Graph Library

Changeset 774:4297098d9677 in lemon-0.x for src/hugo/skeletons/graph.h


Ignore:
Timestamp:
08/30/04 14:01:47 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1066
Message:

Merge back the whole branches/hugo++ to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/skeletons/graph.h

    r732 r774  
    3535    public:
    3636      /// Defalult constructor.
    37       StaticGraphSkeleton() {}
     37      StaticGraphSkeleton() { }
    3838      ///Copy consructor.
    3939
    4040      ///\todo It is not clear, what we expect from a copy constructor.
    4141      ///E.g. How to assign the nodes/edges to each other? What about maps?
    42       StaticGraphSkeleton(const StaticGraphSkeleton &G) {}
    43 
    44       /// The base type of the node iterators.
    45 
    46       /// This is the base type of each node iterators,
    47       /// thus each kind of node iterator will convert to this.
     42      StaticGraphSkeleton(const StaticGraphSkeleton& g) { }
     43
     44      /// The base type of node iterators,
     45      /// or in other words, the trivial node iterator.
     46
     47      /// This is the base type of each node iterator,
     48      /// thus each kind of node iterator converts to this.
     49      /// More precisely each kind of node iterator have to be inherited
     50      /// from the trivial node iterator.
    4851      class Node {
    4952      public:
    5053        /// @warning The default constructor sets the iterator
    5154        /// to an undefined value.
    52         Node() {}   //FIXME
     55        Node() { }
     56        /// Copy constructor.
     57        Node(const Node&) { }
    5358        /// Invalid constructor \& conversion.
    5459
    5560        /// This constructor initializes the iterator to be invalid.
    5661        /// \sa Invalid for more details.
    57 
    58         Node(Invalid) {}
    59         //Node(const Node &) {}
    60 
     62        Node(Invalid) { }
    6163        /// Two iterators are equal if and only if they point to the
    6264        /// same object or both are invalid.
     
    7476      /// This iterator goes through each node.
    7577      /// Its usage is quite simple, for example you can count the number
    76       /// of nodes in graph \c G of type \c Graph like this:
     78      /// of nodes in graph \c g of type \c Graph like this:
    7779      /// \code
    78       ///int count=0;
    79       ///for(Graph::NodeIt n(G);G.valid(n);G.next(n)) count++;
     80      /// int count=0;
     81      /// for (Graph::NodeIt n(g); g.valid(n); ++n) ++count;
    8082      /// \endcode
    8183      class NodeIt : public Node {
     
    8385        /// @warning The default constructor sets the iterator
    8486        /// to an undefined value.
    85         NodeIt() {} //FIXME
     87        NodeIt() { }
     88        /// Copy constructor.
     89        NodeIt(const NodeIt&) { }
    8690        /// Invalid constructor \& conversion.
    8791
    88         /// Initialize the iterator to be invalid
     92        /// Initialize the iterator to be invalid.
    8993        /// \sa Invalid for more details.
    90         NodeIt(Invalid) {}
    91         /// Sets the iterator to the first node of \c G.
    92         NodeIt(const StaticGraphSkeleton &) {}
    93         /// @warning The default constructor sets the iterator
    94         /// to an undefined value.
    95         NodeIt(const NodeIt &n) : Node(n) {}
     94        NodeIt(Invalid) { }
     95        /// Sets the iterator to the first node of \c g.
     96        NodeIt(const StaticGraphSkeleton& g) { }
     97        /// Sets the iterator to the node of \c g pointed by the trivial
     98        /// iterator n. This feature necessitates that each time we
     99        /// iterate the node-set, the iteration order is the same.
     100        NodeIt(const StaticGraphSkeleton& g, const Node& n) { }
     101        /// Assign the iterator to the next node.
     102        NodeIt& operator++() { return *this; }
    96103      };
    97104   
     
    102109        /// @warning The default constructor sets the iterator
    103110        /// to an undefined value.
    104         Edge() {}   //FIXME
    105         /// Initialize the iterator to be invalid
    106         Edge(Invalid) {}
     111        Edge() { }
     112        /// Copy constructor.
     113        Edge(const Edge&) { }
     114        /// Initialize the iterator to be invalid.
     115        Edge(Invalid) { }
    107116        /// Two iterators are equal if and only if they point to the
    108117        /// same object or both are invalid.
     
    118127      /// Its usage is quite simple, for example you can count the number
    119128      /// of outgoing edges of a node \c n
    120       /// in graph \c G of type \c Graph as follows.
     129      /// in graph \c g of type \c Graph as follows.
    121130      /// \code
    122       ///int count=0;
    123       ///for(Graph::OutEdgeIt e(G,n);G.valid(e);G.next(e)) count++;
     131      /// int count=0;
     132      /// for (Graph::OutEdgeIt e(g, n); g.valid(e); ++e) ++count;
    124133      /// \endcode
    125134   
     
    128137        /// @warning The default constructor sets the iterator
    129138        /// to an undefined value.
    130         OutEdgeIt() {}
    131         /// Initialize the iterator to be invalid
    132         OutEdgeIt(Invalid) {}
     139        OutEdgeIt() { }
     140        /// Copy constructor.
     141        OutEdgeIt(const OutEdgeIt&) { }
     142        /// Initialize the iterator to be invalid.
     143        OutEdgeIt(Invalid) { }
    133144        /// This constructor sets the iterator to first outgoing edge.
    134145   
     
    136147        /// node
    137148        ///@param n the node
    138         ///@param G the graph
    139         OutEdgeIt(const StaticGraphSkeleton &, Node) {}
     149        ///@param g the graph
     150        OutEdgeIt(const StaticGraphSkeleton& g, const Node& n) { }
     151        /// Sets the iterator to the value of the trivial iterator \c e.
     152        /// This feature necessitates that each time we
     153        /// iterate the edge-set, the iteration order is the same.
     154        OutEdgeIt(const StaticGraphSkeleton& g, const Edge& e) { }
     155        /// Assign the iterator to the next outedge of the corresponding node.
     156        OutEdgeIt& operator++() { return *this; }
    140157      };
    141158
     
    146163      /// Its usage is quite simple, for example you can count the number
    147164      /// of outgoing edges of a node \c n
    148       /// in graph \c G of type \c Graph as follows.
     165      /// in graph \c g of type \c Graph as follows.
    149166      /// \code
    150       ///int count=0;
    151       ///for(Graph::InEdgeIt e(G,n);G.valid(e);G.next(e)) count++;
     167      /// int count=0;
     168      /// for(Graph::InEdgeIt e(g, n); g.valid(e); ++) ++count;
    152169      /// \endcode
    153170
     
    156173        /// @warning The default constructor sets the iterator
    157174        /// to an undefined value.
    158         InEdgeIt() {}
    159         /// Initialize the iterator to be invalid
    160         InEdgeIt(Invalid) {}
    161         InEdgeIt(const StaticGraphSkeleton &, Node) {}   
     175        InEdgeIt() { }
     176        /// Copy constructor.
     177        InEdgeIt(const InEdgeIt&) { }
     178        /// Initialize the iterator to be invalid.
     179        InEdgeIt(Invalid) { }
     180        /// .
     181        InEdgeIt(const StaticGraphSkeleton&, const Node&) { }
     182        /// .
     183        InEdgeIt(const StaticGraphSkeleton&, const Edge&) { }
     184        /// Assign the iterator to the next inedge of the corresponding node.
     185        InEdgeIt& operator++() { return *this; }
    162186      };
    163187      //  class SymEdgeIt : public Edge {};
     
    167191      /// This iterator goes through each edge of a graph.
    168192      /// Its usage is quite simple, for example you can count the number
    169       /// of edges in a graph \c G of type \c Graph as follows:
     193      /// of edges in a graph \c g of type \c Graph as follows:
    170194      /// \code
    171       ///int count=0;
    172       ///for(Graph::EdgeIt e(G);G.valid(e);G.next(e)) count++;
     195      /// int count=0;
     196      /// for(Graph::EdgeIt e(g); g.valid(e); ++e) ++count;
    173197      /// \endcode
    174198      class EdgeIt : public Edge {
     
    176200        /// @warning The default constructor sets the iterator
    177201        /// to an undefined value.
    178         EdgeIt() {}
    179         /// Initialize the iterator to be invalid
    180         EdgeIt(Invalid) {}
    181         EdgeIt(const StaticGraphSkeleton &) {}
     202        EdgeIt() { }
     203        /// Copy constructor.
     204        EdgeIt(const EdgeIt&) { }
     205        /// Initialize the iterator to be invalid.
     206        EdgeIt(Invalid) { }
     207        /// .
     208        EdgeIt(const StaticGraphSkeleton&) { }
     209        /// .
     210        EdgeIt(const StaticGraphSkeleton&, const Edge&) { }
     211        EdgeIt& operator++() { return *this; }
    182212      };
    183213
     
    187217      /// \return the first node.
    188218      ///
    189       NodeIt &first(NodeIt &i) const { return i;}
     219      NodeIt& first(NodeIt& i) const { return i; }
    190220
    191221      /// The first incoming edge.
    192       InEdgeIt &first(InEdgeIt &i, Node) const { return i;}
     222      InEdgeIt& first(InEdgeIt &i, Node) const { return i; }
    193223      /// The first outgoing edge.
    194       OutEdgeIt &first(OutEdgeIt &i, Node) const { return i;}
    195       //  SymEdgeIt &first(SymEdgeIt &, Node) const { return i;}
     224      OutEdgeIt& first(OutEdgeIt& i, Node) const { return i; }
     225      //  SymEdgeIt& first(SymEdgeIt&, Node) const { return i; }
    196226      /// The first edge of the Graph.
    197       EdgeIt &first(EdgeIt &i) const { return i;}
     227      EdgeIt& first(EdgeIt& i) const { return i; }
    198228
    199229      //     Node getNext(Node) const {}
     
    204234
    205235      /// Go to the next node.
    206       NodeIt &next(NodeIt &i) const { return i;}
     236      NodeIt& next(NodeIt& i) const { return i; }
    207237      /// Go to the next incoming edge.
    208       InEdgeIt &next(InEdgeIt &i) const { return i;}
     238      InEdgeIt& next(InEdgeIt& i) const { return i; }
    209239      /// Go to the next outgoing edge.
    210       OutEdgeIt &next(OutEdgeIt &i) const { return i;}
    211       //SymEdgeIt &next(SymEdgeIt &) const {}
     240      OutEdgeIt& next(OutEdgeIt& i) const { return i; }
     241      //SymEdgeIt& next(SymEdgeIt&) const { }
    212242      /// Go to the next edge.
    213       EdgeIt &next(EdgeIt &i) const { return i;}
     243      EdgeIt& next(EdgeIt& i) const { return i; }
    214244
    215245      ///Gives back the head node of an edge.
     
    230260      ///\todo Maybe, it would be better if iterator converted to
    231261      ///bool directly, as Jacint prefers.
    232       bool valid(const Node&) const { return true;}
     262      bool valid(const Node&) const { return true; }
    233263      /// Checks if an edge iterator is valid
    234264
    235265      ///\todo Maybe, it would be better if iterator converted to
    236266      ///bool directly, as Jacint prefers.
    237       bool valid(const Edge&) const { return true;}
     267      bool valid(const Edge&) const { return true; }
    238268
    239269      ///Gives back the \e id of a node.
     
    241271      ///\warning Not all graph structures provide this feature.
    242272      ///
    243       int id(const Node&) const { return 0;}
     273      int id(const Node&) const { return 0; }
    244274      ///Gives back the \e id of an edge.
    245275
    246276      ///\warning Not all graph structures provide this feature.
    247277      ///
    248       int id(const Edge&) const { return 0;}
     278      int id(const Edge&) const { return 0; }
    249279
    250280      /// Resets the graph.
     
    252282      /// This function deletes all edges and nodes of the graph.
    253283      /// It also frees the memory allocated to store them.
    254       void clear() {}
    255 
    256       int nodeNum() const { return 0;}
    257       int edgeNum() const { return 0;}
    258 
     284      void clear() { }
     285
     286      int nodeNum() const { return 0; }
     287      int edgeNum() const { return 0; }
    259288
    260289
     
    271300      public:
    272301
    273         class ReferenceMap<Node,T>;
    274 
    275         NodeMap(const StaticGraphSkeleton &) {}
    276         NodeMap(const StaticGraphSkeleton &, T) {}
     302        NodeMap(const StaticGraphSkeleton&) { }
     303        NodeMap(const StaticGraphSkeleton&, T) { }
    277304
    278305        ///Copy constructor
    279         template<typename TT> NodeMap(const NodeMap<TT> &) {}
     306        template<typename TT> NodeMap(const NodeMap<TT>&) { }
    280307        ///Assignment operator
    281         template<typename TT> NodeMap &operator=(const NodeMap<TT> &)
    282         {return *this;}
     308        template<typename TT> NodeMap& operator=(const NodeMap<TT>&)
     309        { return *this; }
    283310      };
    284311
     
    296323        typedef Edge KeyType;
    297324
    298         EdgeMap(const StaticGraphSkeleton &) {}
    299         EdgeMap(const StaticGraphSkeleton &, T ) {}
     325        EdgeMap(const StaticGraphSkeleton&) { }
     326        EdgeMap(const StaticGraphSkeleton&, T) { }
    300327   
    301328        ///Copy constructor
    302         template<typename TT> EdgeMap(const EdgeMap<TT> &) {}
     329        template<typename TT> EdgeMap(const EdgeMap<TT>&) { }
    303330        ///Assignment operator
    304         template<typename TT> EdgeMap &operator=(const EdgeMap<TT> &)
    305         {return *this;}
     331        template<typename TT> EdgeMap &operator=(const EdgeMap<TT>&)
     332        { return *this; }
    306333      };
    307334    };
     
    318345    public:
    319346      /// Defalult constructor.
    320       GraphSkeleton() {}
     347      GraphSkeleton() { }
    321348      ///Copy consructor.
    322349
    323350      ///\todo It is not clear, what we expect from a copy constructor.
    324351      ///E.g. How to assign the nodes/edges to each other? What about maps?
    325       GraphSkeleton(const GraphSkeleton &G) {}
     352      GraphSkeleton(const GraphSkeleton&) { }
    326353
    327354      ///Add a new node to the graph.
     
    329356      /// \return the new node.
    330357      ///
    331       Node addNode() { return INVALID;}
     358      Node addNode() { return INVALID; }
    332359      ///Add a new edge to the graph.
    333360
     
    335362      ///and head node \c head.
    336363      ///\return the new edge.
    337       Edge addEdge(Node, Node) { return INVALID;}
     364      Edge addEdge(Node, Node) { return INVALID; }
    338365   
    339366      /// Resets the graph.
     
    342369      /// It also frees the memory allocated to store them.
    343370      /// \todo It might belong to \c EraseableGraphSkeleton.
    344       void clear() {}
     371      void clear() { }
    345372    };
    346373
     
    353380    public:
    354381      /// Deletes a node.
    355       void erase(Node n) {}
     382      void erase(Node n) { }
    356383      /// Deletes an edge.
    357       void erase(Edge e) {}
     384      void erase(Edge e) { }
    358385
    359386      /// Defalult constructor.
    360       EraseableGraphSkeleton() {}
     387      EraseableGraphSkeleton() { }
    361388      ///Copy consructor.
    362       EraseableGraphSkeleton(const GraphSkeleton &G) {}
     389      EraseableGraphSkeleton(const GraphSkeleton&) { }
    363390    };
    364391
Note: See TracChangeset for help on using the changeset viewer.