COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/concepts/graph.h

    r263 r704  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    2121///\brief The concept of Undirected Graphs.
    2222
    23 #ifndef LEMON_CONCEPT_GRAPH_H
    24 #define LEMON_CONCEPT_GRAPH_H
     23#ifndef LEMON_CONCEPTS_GRAPH_H
     24#define LEMON_CONCEPTS_GRAPH_H
    2525
    2626#include <lemon/concepts/graph_components.h>
    27 #include <lemon/concepts/graph.h>
    2827#include <lemon/core.h>
    2928
     
    312311      /// The directed arc type. It can be converted to the
    313312      /// edge or it should be inherited from the undirected
    314       /// arc.
    315       class Arc : public Edge {
     313      /// edge.
     314      class Arc {
    316315      public:
    317316        /// Default constructor
     
    324323        /// Copy constructor.
    325324        ///
    326         Arc(const Arc& e) : Edge(e) { }
     325        Arc(const Arc&) { }
    327326        /// Initialize the iterator to be invalid.
    328327
     
    351350        bool operator<(Arc) const { return false; }
    352351
     352        /// Converison to Edge
     353        operator Edge() const { return Edge(); }
    353354      };
    354355      /// This iterator goes through each directed arc.
     
    499500      };
    500501
    501       /// \brief Read write map of the nodes to type \c T.
    502       ///
    503       /// ReadWrite map of the nodes to type \c T.
    504       /// \sa Reference
     502      /// \brief Reference map of the nodes to type \c T.
     503      ///
     504      /// Reference map of the nodes to type \c T.
    505505      template<class T>
    506       class NodeMap : public ReadWriteMap< Node, T >
     506      class NodeMap : public ReferenceMap<Node, T, T&, const T&>
    507507      {
    508508      public:
     
    515515      private:
    516516        ///Copy constructor
    517         NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
     517        NodeMap(const NodeMap& nm) :
     518          ReferenceMap<Node, T, T&, const T&>(nm) { }
    518519        ///Assignment operator
    519520        template <typename CMap>
     
    524525      };
    525526
    526       /// \brief Read write map of the directed arcs to type \c T.
    527       ///
    528       /// Reference map of the directed arcs to type \c T.
    529       /// \sa Reference
     527      /// \brief Reference map of the arcs to type \c T.
     528      ///
     529      /// Reference map of the arcs to type \c T.
    530530      template<class T>
    531       class ArcMap : public ReadWriteMap<Arc,T>
     531      class ArcMap : public ReferenceMap<Arc, T, T&, const T&>
    532532      {
    533533      public:
     
    539539      private:
    540540        ///Copy constructor
    541         ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
     541        ArcMap(const ArcMap& em) :
     542          ReferenceMap<Arc, T, T&, const T&>(em) { }
    542543        ///Assignment operator
    543544        template <typename CMap>
     
    548549      };
    549550
    550       /// Read write map of the edges to type \c T.
    551 
    552       /// Reference map of the arcs to type \c T.
    553       /// \sa Reference
     551      /// Reference map of the edges to type \c T.
     552
     553      /// Reference map of the edges to type \c T.
    554554      template<class T>
    555       class EdgeMap : public ReadWriteMap<Edge,T>
     555      class EdgeMap : public ReferenceMap<Edge, T, T&, const T&>
    556556      {
    557557      public:
     
    563563      private:
    564564        ///Copy constructor
    565         EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) {}
     565        EdgeMap(const EdgeMap& em) :
     566          ReferenceMap<Edge, T, T&, const T&>(em) {}
    566567        ///Assignment operator
    567568        template <typename CMap>
     
    603604      /// \brief Opposite node on an arc
    604605      ///
    605       /// \return the opposite of the given Node on the given Edge
     606      /// \return The opposite of the given node on the given edge.
    606607      Node oppositeNode(Node, Edge) const { return INVALID; }
    607608
    608609      /// \brief First node of the edge.
    609610      ///
    610       /// \return the first node of the given Edge.
     611      /// \return The first node of the given edge.
    611612      ///
    612613      /// Naturally edges don't have direction and thus
    613       /// don't have source and target node. But we use these two methods
    614       /// to query the two nodes of the arc. The direction of the arc
    615       /// which arises this way is called the inherent direction of the
     614      /// don't have source and target node. However we use \c u() and \c v()
     615      /// methods to query the two nodes of the arc. The direction of the
     616      /// arc which arises this way is called the inherent direction of the
    616617      /// edge, and is used to define the "default" direction
    617618      /// of the directed versions of the arcs.
    618       /// \sa direction
     619      /// \sa v()
     620      /// \sa direction()
    619621      Node u(Edge) const { return INVALID; }
    620622
    621623      /// \brief Second node of the edge.
     624      ///
     625      /// \return The second node of the given edge.
     626      ///
     627      /// Naturally edges don't have direction and thus
     628      /// don't have source and target node. However we use \c u() and \c v()
     629      /// methods to query the two nodes of the arc. The direction of the
     630      /// arc which arises this way is called the inherent direction of the
     631      /// edge, and is used to define the "default" direction
     632      /// of the directed versions of the arcs.
     633      /// \sa u()
     634      /// \sa direction()
    622635      Node v(Edge) const { return INVALID; }
    623636
     
    738751      struct Constraints {
    739752        void constraints() {
     753          checkConcept<BaseGraphComponent, _Graph>();
    740754          checkConcept<IterableGraphComponent<>, _Graph>();
    741755          checkConcept<IDableGraphComponent<>, _Graph>();
Note: See TracChangeset for help on using the changeset viewer.