COIN-OR::LEMON - Graph Library

Ticket #150: fe86041c013c.patch

File fe86041c013c.patch, 51.3 KB (added by Peter Kovacs, 11 years ago)
  • lemon/core.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1222416066 -7200
    # Node ID fe86041c013c5fbc02bf1ac64774204dd415394b
    # Parent  7abfb55f1ecc813ea33ff03ec3f5e909d1e738b2
    Rename graph copying classes + many doc improvements in core.h
     - GraphCopy --> CopyGraph
     - DigraphCopy --> CopyDigraph
    
    diff --git a/lemon/core.h b/lemon/core.h
    a b  
    5858  /// \addtogroup gutils
    5959  /// @{
    6060
    61   ///Creates convenience typedefs for the digraph types and iterators
     61  ///Create convenient typedefs for the digraph types and iterators
    6262
    63   ///This \c \#define creates convenience typedefs for the following types
    64   ///of \c Digraph: \c Node,  \c NodeIt, \c Arc, \c ArcIt, \c InArcIt,
     63  ///This \c \#define creates convenient type definitions for the following
     64  ///types of \c Digraph: \c Node,  \c NodeIt, \c Arc, \c ArcIt, \c InArcIt,
    6565  ///\c OutArcIt, \c BoolNodeMap, \c IntNodeMap, \c DoubleNodeMap,
    6666  ///\c BoolArcMap, \c IntArcMap, \c DoubleArcMap.
    6767  ///
     
    8080  typedef Digraph::NodeMap<double> DoubleNodeMap;                       \
    8181  typedef Digraph::ArcMap<bool> BoolArcMap;                             \
    8282  typedef Digraph::ArcMap<int> IntArcMap;                               \
    83   typedef Digraph::ArcMap<double> DoubleArcMap
     83  typedef Digraph::ArcMap<double> DoubleArcMap;
    8484
    85   ///Creates convenience typedefs for the digraph types and iterators
     85  ///Create convenient typedefs for the digraph types and iterators
    8686
    8787  ///\see DIGRAPH_TYPEDEFS
    8888  ///
     
    100100  typedef typename Digraph::template NodeMap<double> DoubleNodeMap;     \
    101101  typedef typename Digraph::template ArcMap<bool> BoolArcMap;           \
    102102  typedef typename Digraph::template ArcMap<int> IntArcMap;             \
    103   typedef typename Digraph::template ArcMap<double> DoubleArcMap
     103  typedef typename Digraph::template ArcMap<double> DoubleArcMap;
    104104
    105   ///Creates convenience typedefs for the graph types and iterators
     105  ///Create convenient typedefs for the graph types and iterators
    106106
    107   ///This \c \#define creates the same convenience typedefs as defined
     107  ///This \c \#define creates the same convenient type definitions as defined
    108108  ///by \ref DIGRAPH_TYPEDEFS(Graph) and six more, namely it creates
    109109  ///\c Edge, \c EdgeIt, \c IncEdgeIt, \c BoolEdgeMap, \c IntEdgeMap,
    110110  ///\c DoubleEdgeMap.
    111111  ///
    112112  ///\note If the graph type is a dependent type, ie. the graph type depend
    113   ///on a template parameter, then use \c TEMPLATE_DIGRAPH_TYPEDEFS()
     113  ///on a template parameter, then use \c TEMPLATE_GRAPH_TYPEDEFS()
    114114  ///macro.
    115115#define GRAPH_TYPEDEFS(Graph)                                           \
    116116  DIGRAPH_TYPEDEFS(Graph);                                              \
     
    119119  typedef Graph::IncEdgeIt IncEdgeIt;                                   \
    120120  typedef Graph::EdgeMap<bool> BoolEdgeMap;                             \
    121121  typedef Graph::EdgeMap<int> IntEdgeMap;                               \
    122   typedef Graph::EdgeMap<double> DoubleEdgeMap
     122  typedef Graph::EdgeMap<double> DoubleEdgeMap;
    123123
    124   ///Creates convenience typedefs for the graph types and iterators
     124  ///Create convenient typedefs for the graph types and iterators
    125125
    126126  ///\see GRAPH_TYPEDEFS
    127127  ///
     
    134134  typedef typename Graph::IncEdgeIt IncEdgeIt;                          \
    135135  typedef typename Graph::template EdgeMap<bool> BoolEdgeMap;           \
    136136  typedef typename Graph::template EdgeMap<int> IntEdgeMap;             \
    137   typedef typename Graph::template EdgeMap<double> DoubleEdgeMap
     137  typedef typename Graph::template EdgeMap<double> DoubleEdgeMap;
    138138
    139   /// \brief Function to count the items in the graph.
     139  /// \brief Function to count the items in a graph.
    140140  ///
    141   /// This function counts the items (nodes, arcs etc) in the graph.
    142   /// The complexity of the function is O(n) because
     141  /// This function counts the items (nodes, arcs etc.) in a graph.
     142  /// The complexity of the function is linear because
    143143  /// it iterates on all of the items.
    144144  template <typename Graph, typename Item>
    145145  inline int countItems(const Graph& g) {
     
    176176  /// \brief Function to count the nodes in the graph.
    177177  ///
    178178  /// This function counts the nodes in the graph.
    179   /// The complexity of the function is O(n) but for some
    180   /// graph structures it is specialized to run in O(1).
     179  /// The complexity of the function is <em>O</em>(<em>n</em>), but for some
     180  /// graph structures it is specialized to run in <em>O</em>(1).
    181181  ///
    182   /// If the graph contains a \e nodeNum() member function and a
    183   /// \e NodeNumTag tag then this function calls directly the member
     182  /// \note If the graph contains a \c nodeNum() member function and a
     183  /// \c NodeNumTag tag then this function calls directly the member
    184184  /// function to query the cardinality of the node set.
    185185  template <typename Graph>
    186186  inline int countNodes(const Graph& g) {
     
    212212  /// \brief Function to count the arcs in the graph.
    213213  ///
    214214  /// This function counts the arcs in the graph.
    215   /// The complexity of the function is O(e) but for some
    216   /// graph structures it is specialized to run in O(1).
     215  /// The complexity of the function is <em>O</em>(<em>m</em>), but for some
     216  /// graph structures it is specialized to run in <em>O</em>(1).
    217217  ///
    218   /// If the graph contains a \e arcNum() member function and a
    219   /// \e EdgeNumTag tag then this function calls directly the member
     218  /// \note If the graph contains a \c arcNum() member function and a
     219  /// \c ArcNumTag tag then this function calls directly the member
    220220  /// function to query the cardinality of the arc set.
    221221  template <typename Graph>
    222222  inline int countArcs(const Graph& g) {
     
    224224  }
    225225
    226226  // Edge counting:
     227
    227228  namespace _core_bits {
    228229
    229230    template <typename Graph, typename Enable = void>
     
    247248  /// \brief Function to count the edges in the graph.
    248249  ///
    249250  /// This function counts the edges in the graph.
    250   /// The complexity of the function is O(m) but for some
    251   /// graph structures it is specialized to run in O(1).
     251  /// The complexity of the function is <em>O</em>(<em>m</em>), but for some
     252  /// graph structures it is specialized to run in <em>O</em>(1).
    252253  ///
    253   /// If the graph contains a \e edgeNum() member function and a
    254   /// \e EdgeNumTag tag then this function calls directly the member
     254  /// \note If the graph contains a \c edgeNum() member function and a
     255  /// \c EdgeNumTag tag then this function calls directly the member
    255256  /// function to query the cardinality of the edge set.
    256257  template <typename Graph>
    257258  inline int countEdges(const Graph& g) {
     
    272273  /// \brief Function to count the number of the out-arcs from node \c n.
    273274  ///
    274275  /// This function counts the number of the out-arcs from node \c n
    275   /// in the graph.
     276  /// in the graph \c g.
    276277  template <typename Graph>
    277   inline int countOutArcs(const Graph& _g,  const typename Graph::Node& _n) {
    278     return countNodeDegree<Graph, typename Graph::OutArcIt>(_g, _n);
     278  inline int countOutArcs(const Graph& g,  const typename Graph::Node& n) {
     279    return countNodeDegree<Graph, typename Graph::OutArcIt>(g, n);
    279280  }
    280281
    281282  /// \brief Function to count the number of the in-arcs to node \c n.
    282283  ///
    283284  /// This function counts the number of the in-arcs to node \c n
    284   /// in the graph.
     285  /// in the graph \c g.
    285286  template <typename Graph>
    286   inline int countInArcs(const Graph& _g,  const typename Graph::Node& _n) {
    287     return countNodeDegree<Graph, typename Graph::InArcIt>(_g, _n);
     287  inline int countInArcs(const Graph& g,  const typename Graph::Node& n) {
     288    return countNodeDegree<Graph, typename Graph::InArcIt>(g, n);
    288289  }
    289290
    290291  /// \brief Function to count the number of the inc-edges to node \c n.
    291292  ///
    292293  /// This function counts the number of the inc-edges to node \c n
    293   /// in the graph.
     294  /// in the undirected graph \c g.
    294295  template <typename Graph>
    295   inline int countIncEdges(const Graph& _g,  const typename Graph::Node& _n) {
    296     return countNodeDegree<Graph, typename Graph::IncEdgeIt>(_g, _n);
     296  inline int countIncEdges(const Graph& g,  const typename Graph::Node& n) {
     297    return countNodeDegree<Graph, typename Graph::IncEdgeIt>(g, n);
    297298  }
    298299
    299300  namespace _core_bits {
     
    377378    };
    378379
    379380    template <typename Digraph, typename Enable = void>
    380     struct DigraphCopySelector {
     381    struct CopyDigraphSelector {
    381382      template <typename From, typename NodeRefMap, typename ArcRefMap>
    382383      static void copy(Digraph &to, const From& from,
    383384                       NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) {
     
    392393    };
    393394
    394395    template <typename Digraph>
    395     struct DigraphCopySelector<
     396    struct CopyDigraphSelector<
    396397      Digraph,
    397398      typename enable_if<typename Digraph::BuildTag, void>::type>
    398399    {
     
    404405    };
    405406
    406407    template <typename Graph, typename Enable = void>
    407     struct GraphCopySelector {
     408    struct CopyGraphSelector {
    408409      template <typename From, typename NodeRefMap, typename EdgeRefMap>
    409410      static void copy(Graph &to, const From& from,
    410411                       NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
     
    419420    };
    420421
    421422    template <typename Graph>
    422     struct GraphCopySelector<
     423    struct CopyGraphSelector<
    423424      Graph,
    424425      typename enable_if<typename Graph::BuildTag, void>::type>
    425426    {
     
    437438  /// Class to copy a digraph to another digraph (duplicate a digraph). The
    438439  /// simplest way of using it is through the \c copyDigraph() function.
    439440  ///
    440   /// This class not just make a copy of a graph, but it can create
     441  /// This class not only make a copy of a digraph, but it can create
    441442  /// references and cross references between the nodes and arcs of
    442   /// the two graphs, it can copy maps for use with the newly created
    443   /// graph and copy nodes and arcs.
     443  /// the two digraphs, and it can copy maps to use with the newly created
     444  /// digraph.
    444445  ///
    445   /// To make a copy from a graph, first an instance of DigraphCopy
    446   /// should be created, then the data belongs to the graph should
     446  /// To make a copy from a digraph, first an instance of CopyDigraph
     447  /// should be created, then the data belongs to the digraph should
    447448  /// assigned to copy. In the end, the \c run() member should be
    448449  /// called.
    449450  ///
    450   /// The next code copies a graph with several data:
     451  /// The next code copies a digraph with several data:
    451452  ///\code
    452   ///  DigraphCopy<NewGraph, OrigGraph> dc(new_graph, orig_graph);
    453   ///  // create a reference for the nodes
     453  ///  CopyDigraph<NewGraph, OrigGraph> cg(new_graph, orig_graph);
     454  ///  // Create references for the nodes
    454455  ///  OrigGraph::NodeMap<NewGraph::Node> nr(orig_graph);
    455   ///  dc.nodeRef(nr);
    456   ///  // create a cross reference (inverse) for the arcs
     456  ///  cg.nodeRef(nr);
     457  ///  // Create cross references (inverse) for the arcs
    457458  ///  NewGraph::ArcMap<OrigGraph::Arc> acr(new_graph);
    458   ///  dc.arcCrossRef(acr);
    459   ///  // copy an arc map
     459  ///  cg.arcCrossRef(acr);
     460  ///  // Copy an arc map
    460461  ///  OrigGraph::ArcMap<double> oamap(orig_graph);
    461462  ///  NewGraph::ArcMap<double> namap(new_graph);
    462   ///  dc.arcMap(namap, oamap);
    463   ///  // copy a node
     463  ///  cg.arcMap(namap, oamap);
     464  ///  // Copy a node
    464465  ///  OrigGraph::Node on;
    465466  ///  NewGraph::Node nn;
    466   ///  dc.node(nn, on);
    467   ///  // Executions of copy
    468   ///  dc.run();
     467  ///  cg.node(nn, on);
     468  ///  // Execute copying
     469  ///  cg.run();
    469470  ///\endcode
    470471  template <typename To, typename From>
    471   class DigraphCopy {
     472  class CopyDigraph {
    472473  private:
    473474
    474475    typedef typename From::Node Node;
     
    482483    typedef typename From::template NodeMap<TNode> NodeRefMap;
    483484    typedef typename From::template ArcMap<TArc> ArcRefMap;
    484485
    485 
    486486  public:
    487487
    488 
    489     /// \brief Constructor for the DigraphCopy.
     488    /// \brief Constructor of CopyDigraph.
    490489    ///
    491     /// It copies the content of the \c _from digraph into the
    492     /// \c _to digraph.
    493     DigraphCopy(To& to, const From& from)
     490    /// Constructor of CopyDigraph for copying the content of the
     491    /// \c from digraph into the \c to digraph.
     492    CopyDigraph(To& to, const From& from)
    494493      : _from(from), _to(to) {}
    495494
    496     /// \brief Destructor of the DigraphCopy
     495    /// \brief Destructor of CopyDigraph
    497496    ///
    498     /// Destructor of the DigraphCopy
    499     ~DigraphCopy() {
     497    /// Destructor of CopyDigraph.
     498    ~CopyDigraph() {
    500499      for (int i = 0; i < int(_node_maps.size()); ++i) {
    501500        delete _node_maps[i];
    502501      }
     
    506505
    507506    }
    508507
    509     /// \brief Copies the node references into the given map.
     508    /// \brief Copy the node references into the given map.
    510509    ///
    511     /// Copies the node references into the given map. The parameter
    512     /// should be a map, which key type is the Node type of the source
    513     /// graph, while the value type is the Node type of the
    514     /// destination graph.
     510    /// This function copies the node references into the given map.
     511    /// The parameter should be a map, whose key type is the Node type of
     512    /// the source digraph, while the value type is the Node type of the
     513    /// destination digraph.
    515514    template <typename NodeRef>
    516     DigraphCopy& nodeRef(NodeRef& map) {
     515    CopyDigraph& nodeRef(NodeRef& map) {
    517516      _node_maps.push_back(new _core_bits::RefCopy<From, Node,
    518517                           NodeRefMap, NodeRef>(map));
    519518      return *this;
    520519    }
    521520
    522     /// \brief Copies the node cross references into the given map.
     521    /// \brief Copy the node cross references into the given map.
    523522    ///
    524     ///  Copies the node cross references (reverse references) into
    525     ///  the given map. The parameter should be a map, which key type
    526     ///  is the Node type of the destination graph, while the value type is
    527     ///  the Node type of the source graph.
     523    /// This function copies the node cross references (reverse references)
     524    /// into the given map. The parameter should be a map, whose key type
     525    /// is the Node type of the destination digraph, while the value type is
     526    /// the Node type of the source digraph.
    528527    template <typename NodeCrossRef>
    529     DigraphCopy& nodeCrossRef(NodeCrossRef& map) {
     528    CopyDigraph& nodeCrossRef(NodeCrossRef& map) {
    530529      _node_maps.push_back(new _core_bits::CrossRefCopy<From, Node,
    531530                           NodeRefMap, NodeCrossRef>(map));
    532531      return *this;
    533532    }
    534533
    535     /// \brief Make copy of the given map.
     534    /// \brief Make a copy of the given node map.
    536535    ///
    537     /// Makes copy of the given map for the newly created digraph.
    538     /// The new map's key type is the destination graph's node type,
    539     /// and the copied map's key type is the source graph's node type.
     536    /// This function makes a copy of the given node map for the newly
     537    /// created digraph.
     538    /// The key type of the new map \c tmap should be the Node type of the
     539    /// destination digraph, and the key type of the original map \c map
     540    /// should be the Node type of the source digraph.
    540541    template <typename ToMap, typename FromMap>
    541     DigraphCopy& nodeMap(ToMap& tmap, const FromMap& map) {
     542    CopyDigraph& nodeMap(ToMap& tmap, const FromMap& map) {
    542543      _node_maps.push_back(new _core_bits::MapCopy<From, Node,
    543544                           NodeRefMap, ToMap, FromMap>(tmap, map));
    544545      return *this;
     
    546547
    547548    /// \brief Make a copy of the given node.
    548549    ///
    549     /// Make a copy of the given node.
    550     DigraphCopy& node(TNode& tnode, const Node& snode) {
     550    /// This function makes a copy of the given node.
     551    CopyDigraph& node(TNode& tnode, const Node& node) {
    551552      _node_maps.push_back(new _core_bits::ItemCopy<From, Node,
    552                            NodeRefMap, TNode>(tnode, snode));
     553                           NodeRefMap, TNode>(tnode, node));
    553554      return *this;
    554555    }
    555556
    556     /// \brief Copies the arc references into the given map.
     557    /// \brief Copy the arc references into the given map.
    557558    ///
    558     /// Copies the arc references into the given map.
     559    /// This function copies the arc references into the given map.
     560    /// The parameter should be a map, whose key type is the Arc type of
     561    /// the source digraph, while the value type is the Arc type of the
     562    /// destination digraph.
    559563    template <typename ArcRef>
    560     DigraphCopy& arcRef(ArcRef& map) {
     564    CopyDigraph& arcRef(ArcRef& map) {
    561565      _arc_maps.push_back(new _core_bits::RefCopy<From, Arc,
    562566                          ArcRefMap, ArcRef>(map));
    563567      return *this;
    564568    }
    565569
    566     /// \brief Copies the arc cross references into the given map.
     570    /// \brief Copy the arc cross references into the given map.
    567571    ///
    568     ///  Copies the arc cross references (reverse references) into
    569     ///  the given map.
     572    /// This function copies the arc cross references (reverse references)
     573    /// into the given map. The parameter should be a map, whose key type
     574    /// is the Arc type of the destination digraph, while the value type is
     575    /// the Arc type of the source digraph.
    570576    template <typename ArcCrossRef>
    571     DigraphCopy& arcCrossRef(ArcCrossRef& map) {
     577    CopyDigraph& arcCrossRef(ArcCrossRef& map) {
    572578      _arc_maps.push_back(new _core_bits::CrossRefCopy<From, Arc,
    573579                          ArcRefMap, ArcCrossRef>(map));
    574580      return *this;
    575581    }
    576582
    577     /// \brief Make copy of the given map.
     583    /// \brief Make a copy of the given arc map.
    578584    ///
    579     /// Makes copy of the given map for the newly created digraph.
    580     /// The new map's key type is the to digraph's arc type,
    581     /// and the copied map's key type is the from digraph's arc
    582     /// type.
     585    /// This function makes a copy of the given arc map for the newly
     586    /// created digraph.
     587    /// The key type of the new map \c tmap should be the Arc type of the
     588    /// destination digraph, and the key type of the original map \c map
     589    /// should be the Arc type of the source digraph.
    583590    template <typename ToMap, typename FromMap>
    584     DigraphCopy& arcMap(ToMap& tmap, const FromMap& map) {
     591    CopyDigraph& arcMap(ToMap& tmap, const FromMap& map) {
    585592      _arc_maps.push_back(new _core_bits::MapCopy<From, Arc,
    586593                          ArcRefMap, ToMap, FromMap>(tmap, map));
    587594      return *this;
     
    589596
    590597    /// \brief Make a copy of the given arc.
    591598    ///
    592     /// Make a copy of the given arc.
    593     DigraphCopy& arc(TArc& tarc, const Arc& sarc) {
     599    /// This function makes a copy of the given arc.
     600    CopyDigraph& arc(TArc& tarc, const Arc& arc) {
    594601      _arc_maps.push_back(new _core_bits::ItemCopy<From, Arc,
    595                           ArcRefMap, TArc>(tarc, sarc));
     602                          ArcRefMap, TArc>(tarc, arc));
    596603      return *this;
    597604    }
    598605
    599     /// \brief Executes the copies.
     606    /// \brief Execute copying.
    600607    ///
    601     /// Executes the copies.
     608    /// This function executes the copying of the digraph along with the
     609    /// copying of the assigned data.
    602610    void run() {
    603611      NodeRefMap nodeRefMap(_from);
    604612      ArcRefMap arcRefMap(_from);
    605       _core_bits::DigraphCopySelector<To>::
     613      _core_bits::CopyDigraphSelector<To>::
    606614        copy(_to, _from, nodeRefMap, arcRefMap);
    607615      for (int i = 0; i < int(_node_maps.size()); ++i) {
    608616        _node_maps[i]->copy(_from, nodeRefMap);
     
    614622
    615623  protected:
    616624
    617 
    618625    const From& _from;
    619626    To& _to;
    620627
    621628    std::vector<_core_bits::MapCopyBase<From, Node, NodeRefMap>* >
    622     _node_maps;
     629      _node_maps;
    623630
    624631    std::vector<_core_bits::MapCopyBase<From, Arc, ArcRefMap>* >
    625     _arc_maps;
     632      _arc_maps;
    626633
    627634  };
    628635
    629636  /// \brief Copy a digraph to another digraph.
    630637  ///
    631   /// Copy a digraph to another digraph. The complete usage of the
    632   /// function is detailed in the DigraphCopy class, but a short
    633   /// example shows a basic work:
     638  /// This function copies a digraph to another digraph.
     639  /// The complete usage of it is detailed in the CopyDigraph class, but
     640  /// a short example shows a basic work:
    634641  ///\code
    635   /// copyDigraph(trg, src).nodeRef(nr).arcCrossRef(ecr).run();
     642  /// copyDigraph(trg, src).nodeRef(nr).arcCrossRef(acr).run();
    636643  ///\endcode
    637644  ///
    638645  /// After the copy the \c nr map will contain the mapping from the
    639646  /// nodes of the \c from digraph to the nodes of the \c to digraph and
    640   /// \c ecr will contain the mapping from the arcs of the \c to digraph
     647  /// \c acr will contain the mapping from the arcs of the \c to digraph
    641648  /// to the arcs of the \c from digraph.
    642649  ///
    643   /// \see DigraphCopy
     650  /// \see CopyDigraph
    644651  template <typename To, typename From>
    645   DigraphCopy<To, From> copyDigraph(To& to, const From& from) {
    646     return DigraphCopy<To, From>(to, from);
     652  CopyDigraph<To, From> copyDigraph(To& to, const From& from) {
     653    return CopyDigraph<To, From>(to, from);
    647654  }
    648655
    649656  /// \brief Class to copy a graph.
     
    651658  /// Class to copy a graph to another graph (duplicate a graph). The
    652659  /// simplest way of using it is through the \c copyGraph() function.
    653660  ///
    654   /// This class not just make a copy of a graph, but it can create
     661  /// This class not only make a copy of a graph, but it can create
    655662  /// references and cross references between the nodes, edges and arcs of
    656   /// the two graphs, it can copy maps for use with the newly created
    657   /// graph and copy nodes, edges and arcs.
     663  /// the two graphs, and it can copy maps for using with the newly created
     664  /// graph.
    658665  ///
    659   /// To make a copy from a graph, first an instance of GraphCopy
     666  /// To make a copy from a graph, first an instance of CopyGraph
    660667  /// should be created, then the data belongs to the graph should
    661668  /// assigned to copy. In the end, the \c run() member should be
    662669  /// called.
    663670  ///
    664671  /// The next code copies a graph with several data:
    665672  ///\code
    666   ///  GraphCopy<NewGraph, OrigGraph> dc(new_graph, orig_graph);
    667   ///  // create a reference for the nodes
     673  ///  CopyGraph<NewGraph, OrigGraph> cg(new_graph, orig_graph);
     674  ///  // Create references for the nodes
    668675  ///  OrigGraph::NodeMap<NewGraph::Node> nr(orig_graph);
    669   ///  dc.nodeRef(nr);
    670   ///  // create a cross reference (inverse) for the edges
    671   ///  NewGraph::EdgeMap<OrigGraph::Arc> ecr(new_graph);
    672   ///  dc.edgeCrossRef(ecr);
    673   ///  // copy an arc map
    674   ///  OrigGraph::ArcMap<double> oamap(orig_graph);
    675   ///  NewGraph::ArcMap<double> namap(new_graph);
    676   ///  dc.arcMap(namap, oamap);
    677   ///  // copy a node
     676  ///  cg.nodeRef(nr);
     677  ///  // Create cross references (inverse) for the edges
     678  ///  NewGraph::EdgeMap<OrigGraph::Edge> ecr(new_graph);
     679  ///  cg.edgeCrossRef(ecr);
     680  ///  // Copy an edge map
     681  ///  OrigGraph::EdgeMap<double> oemap(orig_graph);
     682  ///  NewGraph::EdgeMap<double> nemap(new_graph);
     683  ///  cg.edgeMap(nemap, oemap);
     684  ///  // Copy a node
    678685  ///  OrigGraph::Node on;
    679686  ///  NewGraph::Node nn;
    680   ///  dc.node(nn, on);
    681   ///  // Executions of copy
    682   ///  dc.run();
     687  ///  cg.node(nn, on);
     688  ///  // Execute copying
     689  ///  cg.run();
    683690  ///\endcode
    684691  template <typename To, typename From>
    685   class GraphCopy {
     692  class CopyGraph {
    686693  private:
    687694
    688695    typedef typename From::Node Node;
     
    722729      const NodeRefMap& _node_ref;
    723730    };
    724731
    725 
    726732  public:
    727733
    728 
    729     /// \brief Constructor for the GraphCopy.
     734    /// \brief Constructor of CopyGraph.
    730735    ///
    731     /// It copies the content of the \c _from graph into the
    732     /// \c _to graph.
    733     GraphCopy(To& to, const From& from)
     736    /// Constructor of CopyGraph for copying the content of the
     737    /// \c from graph into the \c to graph.
     738    CopyGraph(To& to, const From& from)
    734739      : _from(from), _to(to) {}
    735740
    736     /// \brief Destructor of the GraphCopy
     741    /// \brief Destructor of CopyGraph
    737742    ///
    738     /// Destructor of the GraphCopy
    739     ~GraphCopy() {
     743    /// Destructor of CopyGraph.
     744    ~CopyGraph() {
    740745      for (int i = 0; i < int(_node_maps.size()); ++i) {
    741746        delete _node_maps[i];
    742747      }
     
    746751      for (int i = 0; i < int(_edge_maps.size()); ++i) {
    747752        delete _edge_maps[i];
    748753      }
    749 
    750754    }
    751755
    752     /// \brief Copies the node references into the given map.
     756    /// \brief Copy the node references into the given map.
    753757    ///
    754     /// Copies the node references into the given map.
     758    /// This function copies the node references into the given map.
     759    /// The parameter should be a map, whose key type is the Node type of
     760    /// the source graph, while the value type is the Node type of the
     761    /// destination graph.
    755762    template <typename NodeRef>
    756     GraphCopy& nodeRef(NodeRef& map) {
     763    CopyGraph& nodeRef(NodeRef& map) {
    757764      _node_maps.push_back(new _core_bits::RefCopy<From, Node,
    758765                           NodeRefMap, NodeRef>(map));
    759766      return *this;
    760767    }
    761768
    762     /// \brief Copies the node cross references into the given map.
     769    /// \brief Copy the node cross references into the given map.
    763770    ///
    764     ///  Copies the node cross references (reverse references) into
    765     ///  the given map.
     771    /// This function copies the node cross references (reverse references)
     772    /// into the given map. The parameter should be a map, whose key type
     773    /// is the Node type of the destination graph, while the value type is
     774    /// the Node type of the source graph.
    766775    template <typename NodeCrossRef>
    767     GraphCopy& nodeCrossRef(NodeCrossRef& map) {
     776    CopyGraph& nodeCrossRef(NodeCrossRef& map) {
    768777      _node_maps.push_back(new _core_bits::CrossRefCopy<From, Node,
    769778                           NodeRefMap, NodeCrossRef>(map));
    770779      return *this;
    771780    }
    772781
    773     /// \brief Make copy of the given map.
     782    /// \brief Make a copy of the given node map.
    774783    ///
    775     /// Makes copy of the given map for the newly created graph.
    776     /// The new map's key type is the to graph's node type,
    777     /// and the copied map's key type is the from graph's node
    778     /// type.
     784    /// This function makes a copy of the given node map for the newly
     785    /// created graph.
     786    /// The key type of the new map \c tmap should be the Node type of the
     787    /// destination graph, and the key type of the original map \c map
     788    /// should be the Node type of the source graph.
    779789    template <typename ToMap, typename FromMap>
    780     GraphCopy& nodeMap(ToMap& tmap, const FromMap& map) {
     790    CopyGraph& nodeMap(ToMap& tmap, const FromMap& map) {
    781791      _node_maps.push_back(new _core_bits::MapCopy<From, Node,
    782792                           NodeRefMap, ToMap, FromMap>(tmap, map));
    783793      return *this;
     
    785795
    786796    /// \brief Make a copy of the given node.
    787797    ///
    788     /// Make a copy of the given node.
    789     GraphCopy& node(TNode& tnode, const Node& snode) {
     798    /// This function makes a copy of the given node.
     799    CopyGraph& node(TNode& tnode, const Node& node) {
    790800      _node_maps.push_back(new _core_bits::ItemCopy<From, Node,
    791                            NodeRefMap, TNode>(tnode, snode));
     801                           NodeRefMap, TNode>(tnode, node));
    792802      return *this;
    793803    }
    794804
    795     /// \brief Copies the arc references into the given map.
     805    /// \brief Copy the arc references into the given map.
    796806    ///
    797     /// Copies the arc references into the given map.
     807    /// This function copies the arc references into the given map.
     808    /// The parameter should be a map, whose key type is the Arc type of
     809    /// the source graph, while the value type is the Arc type of the
     810    /// destination graph.
    798811    template <typename ArcRef>
    799     GraphCopy& arcRef(ArcRef& map) {
     812    CopyGraph& arcRef(ArcRef& map) {
    800813      _arc_maps.push_back(new _core_bits::RefCopy<From, Arc,
    801814                          ArcRefMap, ArcRef>(map));
    802815      return *this;
    803816    }
    804817
    805     /// \brief Copies the arc cross references into the given map.
     818    /// \brief Copy the arc cross references into the given map.
    806819    ///
    807     ///  Copies the arc cross references (reverse references) into
    808     ///  the given map.
     820    /// This function copies the arc cross references (reverse references)
     821    /// into the given map. The parameter should be a map, whose key type
     822    /// is the Arc type of the destination graph, while the value type is
     823    /// the Arc type of the source graph.
    809824    template <typename ArcCrossRef>
    810     GraphCopy& arcCrossRef(ArcCrossRef& map) {
     825    CopyGraph& arcCrossRef(ArcCrossRef& map) {
    811826      _arc_maps.push_back(new _core_bits::CrossRefCopy<From, Arc,
    812827                          ArcRefMap, ArcCrossRef>(map));
    813828      return *this;
    814829    }
    815830
    816     /// \brief Make copy of the given map.
     831    /// \brief Make a copy of the given arc map.
    817832    ///
    818     /// Makes copy of the given map for the newly created graph.
    819     /// The new map's key type is the to graph's arc type,
    820     /// and the copied map's key type is the from graph's arc
    821     /// type.
     833    /// This function makes a copy of the given arc map for the newly
     834    /// created graph.
     835    /// The key type of the new map \c tmap should be the Arc type of the
     836    /// destination graph, and the key type of the original map \c map
     837    /// should be the Arc type of the source graph.
    822838    template <typename ToMap, typename FromMap>
    823     GraphCopy& arcMap(ToMap& tmap, const FromMap& map) {
     839    CopyGraph& arcMap(ToMap& tmap, const FromMap& map) {
    824840      _arc_maps.push_back(new _core_bits::MapCopy<From, Arc,
    825841                          ArcRefMap, ToMap, FromMap>(tmap, map));
    826842      return *this;
     
    828844
    829845    /// \brief Make a copy of the given arc.
    830846    ///
    831     /// Make a copy of the given arc.
    832     GraphCopy& arc(TArc& tarc, const Arc& sarc) {
     847    /// This function makes a copy of the given arc.
     848    CopyGraph& arc(TArc& tarc, const Arc& arc) {
    833849      _arc_maps.push_back(new _core_bits::ItemCopy<From, Arc,
    834                           ArcRefMap, TArc>(tarc, sarc));
     850                          ArcRefMap, TArc>(tarc, arc));
    835851      return *this;
    836852    }
    837853
    838     /// \brief Copies the edge references into the given map.
     854    /// \brief Copy the edge references into the given map.
    839855    ///
    840     /// Copies the edge references into the given map.
     856    /// This function copies the edge references into the given map.
     857    /// The parameter should be a map, whose key type is the Edge type of
     858    /// the source graph, while the value type is the Edge type of the
     859    /// destination graph.
    841860    template <typename EdgeRef>
    842     GraphCopy& edgeRef(EdgeRef& map) {
     861    CopyGraph& edgeRef(EdgeRef& map) {
    843862      _edge_maps.push_back(new _core_bits::RefCopy<From, Edge,
    844863                           EdgeRefMap, EdgeRef>(map));
    845864      return *this;
    846865    }
    847866
    848     /// \brief Copies the edge cross references into the given map.
     867    /// \brief Copy the edge cross references into the given map.
    849868    ///
    850     /// Copies the edge cross references (reverse
    851     /// references) into the given map.
     869    /// This function copies the edge cross references (reverse references)
     870    /// into the given map. The parameter should be a map, whose key type
     871    /// is the Edge type of the destination graph, while the value type is
     872    /// the Edge type of the source graph.
    852873    template <typename EdgeCrossRef>
    853     GraphCopy& edgeCrossRef(EdgeCrossRef& map) {
     874    CopyGraph& edgeCrossRef(EdgeCrossRef& map) {
    854875      _edge_maps.push_back(new _core_bits::CrossRefCopy<From,
    855876                           Edge, EdgeRefMap, EdgeCrossRef>(map));
    856877      return *this;
    857878    }
    858879
    859     /// \brief Make copy of the given map.
     880    /// \brief Make a copy of the given edge map.
    860881    ///
    861     /// Makes copy of the given map for the newly created graph.
    862     /// The new map's key type is the to graph's edge type,
    863     /// and the copied map's key type is the from graph's edge
    864     /// type.
     882    /// This function makes a copy of the given edge map for the newly
     883    /// created graph.
     884    /// The key type of the new map \c tmap should be the Edge type of the
     885    /// destination graph, and the key type of the original map \c map
     886    /// should be the Edge type of the source graph.
    865887    template <typename ToMap, typename FromMap>
    866     GraphCopy& edgeMap(ToMap& tmap, const FromMap& map) {
     888    CopyGraph& edgeMap(ToMap& tmap, const FromMap& map) {
    867889      _edge_maps.push_back(new _core_bits::MapCopy<From, Edge,
    868890                           EdgeRefMap, ToMap, FromMap>(tmap, map));
    869891      return *this;
     
    871893
    872894    /// \brief Make a copy of the given edge.
    873895    ///
    874     /// Make a copy of the given edge.
    875     GraphCopy& edge(TEdge& tedge, const Edge& sedge) {
     896    /// This function makes a copy of the given edge.
     897    CopyGraph& edge(TEdge& tedge, const Edge& edge) {
    876898      _edge_maps.push_back(new _core_bits::ItemCopy<From, Edge,
    877                            EdgeRefMap, TEdge>(tedge, sedge));
     899                           EdgeRefMap, TEdge>(tedge, edge));
    878900      return *this;
    879901    }
    880902
    881     /// \brief Executes the copies.
     903    /// \brief Execute copying.
    882904    ///
    883     /// Executes the copies.
     905    /// This function executes the copying of the graph along with the
     906    /// copying of the assigned data.
    884907    void run() {
    885908      NodeRefMap nodeRefMap(_from);
    886909      EdgeRefMap edgeRefMap(_from);
    887910      ArcRefMap arcRefMap(_to, _from, edgeRefMap, nodeRefMap);
    888       _core_bits::GraphCopySelector<To>::
     911      _core_bits::CopyGraphSelector<To>::
    889912        copy(_to, _from, nodeRefMap, edgeRefMap);
    890913      for (int i = 0; i < int(_node_maps.size()); ++i) {
    891914        _node_maps[i]->copy(_from, nodeRefMap);
     
    904927    To& _to;
    905928
    906929    std::vector<_core_bits::MapCopyBase<From, Node, NodeRefMap>* >
    907     _node_maps;
     930      _node_maps;
    908931
    909932    std::vector<_core_bits::MapCopyBase<From, Arc, ArcRefMap>* >
    910     _arc_maps;
     933      _arc_maps;
    911934
    912935    std::vector<_core_bits::MapCopyBase<From, Edge, EdgeRefMap>* >
    913     _edge_maps;
     936      _edge_maps;
    914937
    915938  };
    916939
    917940  /// \brief Copy a graph to another graph.
    918941  ///
    919   /// Copy a graph to another graph. The complete usage of the
    920   /// function is detailed in the GraphCopy class, but a short
    921   /// example shows a basic work:
     942  /// This function copies a graph to another graph.
     943  /// The complete usage of it is detailed in the CopyGraph class,
     944  /// but a short example shows a basic work:
    922945  ///\code
    923   /// copyGraph(trg, src).nodeRef(nr).arcCrossRef(ecr).run();
     946  /// copyGraph(trg, src).nodeRef(nr).edgeCrossRef(ecr).run();
    924947  ///\endcode
    925948  ///
    926949  /// After the copy the \c nr map will contain the mapping from the
    927950  /// nodes of the \c from graph to the nodes of the \c to graph and
    928   /// \c ecr will contain the mapping from the arcs of the \c to graph
    929   /// to the arcs of the \c from graph.
     951  /// \c ecr will contain the mapping from the edges of the \c to graph
     952  /// to the edges of the \c from graph.
    930953  ///
    931   /// \see GraphCopy
     954  /// \see CopyGraph
    932955  template <typename To, typename From>
    933   GraphCopy<To, From>
     956  CopyGraph<To, From>
    934957  copyGraph(To& to, const From& from) {
    935     return GraphCopy<To, From>(to, from);
     958    return CopyGraph<To, From>(to, from);
    936959  }
    937960
    938961  namespace _core_bits {
     
    957980    template <typename Graph>
    958981    struct FindArcSelector<
    959982      Graph,
    960       typename enable_if<typename Graph::FindEdgeTag, void>::type>
     983      typename enable_if<typename Graph::FindArcTag, void>::type>
    961984    {
    962985      typedef typename Graph::Node Node;
    963986      typedef typename Graph::Arc Arc;
     
    967990    };
    968991  }
    969992
    970   /// \brief Finds an arc between two nodes of a graph.
     993  /// \brief Find an arc between two nodes of a digraph.
    971994  ///
    972   /// Finds an arc from node \c u to node \c v in graph \c g.
     995  /// This function finds an arc from node \c u to node \c v in the
     996  /// digraph \c g.
    973997  ///
    974998  /// If \c prev is \ref INVALID (this is the default value), then
    975999  /// it finds the first arc from \c u to \c v. Otherwise it looks for
     
    9781002  ///
    9791003  /// Thus you can iterate through each arc from \c u to \c v as it follows.
    9801004  ///\code
    981   /// for(Arc e=findArc(g,u,v);e!=INVALID;e=findArc(g,u,v,e)) {
     1005  /// for(Arc e = findArc(g,u,v); e != INVALID; e = findArc(g,u,v,e)) {
    9821006  ///   ...
    9831007  /// }
    9841008  ///\endcode
    9851009  ///
    986   ///\sa ArcLookUp
    987   ///\sa AllArcLookUp
    988   ///\sa DynArcLookUp
     1010  /// \note \ref ConArcIt provides iterator interface for the same
     1011  /// functionality.
     1012  ///
    9891013  ///\sa ConArcIt
     1014  ///\sa ArcLookUp, AllArcLookUp, DynArcLookUp
    9901015  template <typename Graph>
    9911016  inline typename Graph::Arc
    9921017  findArc(const Graph &g, typename Graph::Node u, typename Graph::Node v,
     
    9941019    return _core_bits::FindArcSelector<Graph>::find(g, u, v, prev);
    9951020  }
    9961021
    997   /// \brief Iterator for iterating on arcs connected the same nodes.
     1022  /// \brief Iterator for iterating on parallel arcs connecting the same nodes.
    9981023  ///
    999   /// Iterator for iterating on arcs connected the same nodes. It is
    1000   /// higher level interface for the findArc() function. You can
     1024  /// Iterator for iterating on parallel arcs connecting the same nodes. It is
     1025  /// a higher level interface for the \ref findArc() function. You can
    10011026  /// use it the following way:
    10021027  ///\code
    10031028  /// for (ConArcIt<Graph> it(g, src, trg); it != INVALID; ++it) {
     
    10061031  ///\endcode
    10071032  ///
    10081033  ///\sa findArc()
    1009   ///\sa ArcLookUp
    1010   ///\sa AllArcLookUp
    1011   ///\sa DynArcLookUp
     1034  ///\sa ArcLookUp, AllArcLookUp, DynArcLookUp
    10121035  template <typename _Graph>
    10131036  class ConArcIt : public _Graph::Arc {
    10141037  public:
     
    10211044
    10221045    /// \brief Constructor.
    10231046    ///
    1024     /// Construct a new ConArcIt iterating on the arcs which
    1025     /// connects the \c u and \c v node.
     1047    /// Construct a new ConArcIt iterating on the arcs that
     1048    /// connects nodes \c u and \c v.
    10261049    ConArcIt(const Graph& g, Node u, Node v) : _graph(g) {
    10271050      Parent::operator=(findArc(_graph, u, v));
    10281051    }
    10291052
    10301053    /// \brief Constructor.
    10311054    ///
    1032     /// Construct a new ConArcIt which continues the iterating from
    1033     /// the \c e arc.
     1055    /// Construct a new ConArcIt that continues the iterating from arc \c a.
    10341056    ConArcIt(const Graph& g, Arc a) : Parent(a), _graph(g) {}
    10351057
    10361058    /// \brief Increment operator.
     
    10911113    };
    10921114  }
    10931115
    1094   /// \brief Finds an edge between two nodes of a graph.
     1116  /// \brief Find an edge between two nodes of a graph.
    10951117  ///
    1096   /// Finds an edge from node \c u to node \c v in graph \c g.
    1097   /// If the node \c u and node \c v is equal then each loop edge
     1118  /// This function finds an edge from node \c u to node \c v in graph \c g.
     1119  /// If node \c u and node \c v is equal then each loop edge
    10981120  /// will be enumerated once.
    10991121  ///
    11001122  /// If \c prev is \ref INVALID (this is the default value), then
    1101   /// it finds the first arc from \c u to \c v. Otherwise it looks for
    1102   /// the next arc from \c u to \c v after \c prev.
    1103   /// \return The found arc or \ref INVALID if there is no such an arc.
     1123  /// it finds the first edge from \c u to \c v. Otherwise it looks for
     1124  /// the next edge from \c u to \c v after \c prev.
     1125  /// \return The found edge or \ref INVALID if there is no such an edge.
    11041126  ///
    1105   /// Thus you can iterate through each arc from \c u to \c v as it follows.
     1127  /// Thus you can iterate through each edge between \c u and \c v
     1128  /// as it follows.
    11061129  ///\code
    1107   /// for(Edge e = findEdge(g,u,v); e != INVALID;
    1108   ///     e = findEdge(g,u,v,e)) {
     1130  /// for(Edge e = findEdge(g,u,v); e != INVALID; e = findEdge(g,u,v,e)) {
    11091131  ///   ...
    11101132  /// }
    11111133  ///\endcode
    11121134  ///
     1135  /// \note \ref ConEdgeIt provides iterator interface for the same
     1136  /// functionality.
     1137  ///
    11131138  ///\sa ConEdgeIt
    1114 
    11151139  template <typename Graph>
    11161140  inline typename Graph::Edge
    11171141  findEdge(const Graph &g, typename Graph::Node u, typename Graph::Node v,
     
    11191143    return _core_bits::FindEdgeSelector<Graph>::find(g, u, v, p);
    11201144  }
    11211145
    1122   /// \brief Iterator for iterating on edges connected the same nodes.
     1146  /// \brief Iterator for iterating on parallel edges connecting the same nodes.
    11231147  ///
    1124   /// Iterator for iterating on edges connected the same nodes. It is
    1125   /// higher level interface for the findEdge() function. You can
     1148  /// Iterator for iterating on parallel edges connecting the same nodes.
     1149  /// It is a higher level interface for the findEdge() function. You can
    11261150  /// use it the following way:
    11271151  ///\code
    1128   /// for (ConEdgeIt<Graph> it(g, src, trg); it != INVALID; ++it) {
     1152  /// for (ConEdgeIt<Graph> it(g, u, v); it != INVALID; ++it) {
    11291153  ///   ...
    11301154  /// }
    11311155  ///\endcode
     
    11431167
    11441168    /// \brief Constructor.
    11451169    ///
    1146     /// Construct a new ConEdgeIt iterating on the edges which
    1147     /// connects the \c u and \c v node.
     1170    /// Construct a new ConEdgeIt iterating on the edges that
     1171    /// connects nodes \c u and \c v.
    11481172    ConEdgeIt(const Graph& g, Node u, Node v) : _graph(g) {
    11491173      Parent::operator=(findEdge(_graph, u, v));
    11501174    }
    11511175
    11521176    /// \brief Constructor.
    11531177    ///
    1154     /// Construct a new ConEdgeIt which continues the iterating from
    1155     /// the \c e edge.
     1178    /// Construct a new ConEdgeIt that continues iterating from edge \c e.
    11561179    ConEdgeIt(const Graph& g, Edge e) : Parent(e), _graph(g) {}
    11571180
    11581181    /// \brief Increment operator.
     
    11681191  };
    11691192
    11701193
    1171   ///Dynamic arc look up between given endpoints.
     1194  ///Dynamic arc look-up between given endpoints.
    11721195
    11731196  ///Using this class, you can find an arc in a digraph from a given
    1174   ///source to a given target in amortized time <em>O(log</em>d<em>)</em>,
     1197  ///source to a given target in amortized time <em>O</em>(log<em>d</em>),
    11751198  ///where <em>d</em> is the out-degree of the source node.
    11761199  ///
    11771200  ///It is possible to find \e all parallel arcs between two nodes with
    11781201  ///the \c operator() member.
    11791202  ///
    1180   ///See the \ref ArcLookUp and \ref AllArcLookUp classes if your
    1181   ///digraph is not changed so frequently.
     1203  ///This is a dynamic data structure. Consider to use \ref ArcLookUp or
     1204  ///\ref AllArcLookUp if your digraph is not changed so frequently.
    11821205  ///
    1183   ///This class uses a self-adjusting binary search tree, Sleator's
    1184   ///and Tarjan's Splay tree for guarantee the logarithmic amortized
    1185   ///time bound for arc lookups. This class also guarantees the
     1206  ///This class uses a self-adjusting binary search tree, the Splay tree
     1207  ///of Sleator and Tarjan to guarantee the logarithmic amortized
     1208  ///time bound for arc look-ups. This class also guarantees the
    11861209  ///optimal time bound in a constant factor for any distribution of
    11871210  ///queries.
    11881211  ///
     
    15071530    ///Find an arc between two nodes.
    15081531
    15091532    ///Find an arc between two nodes.
    1510     ///\param s The source node
    1511     ///\param t The target node
     1533    ///\param s The source node.
     1534    ///\param t The target node.
    15121535    ///\param p The previous arc between \c s and \c t. It it is INVALID or
    15131536    ///not given, the operator finds the first appropriate arc.
    15141537    ///\return An arc from \c s to \c t after \c p or
     
    15191542    ///\code
    15201543    ///DynArcLookUp<ListDigraph> ae(g);
    15211544    ///...
    1522     ///int n=0;
    1523     ///for(Arc e=ae(u,v);e!=INVALID;e=ae(u,v,e)) n++;
     1545    ///int n = 0;
     1546    ///for(Arc a = ae(u,v); a != INVALID; a = ae(u,v,a)) n++;
    15241547    ///\endcode
    15251548    ///
    1526     ///Finding the arcs take at most <em>O(</em>log<em>d)</em>
     1549    ///Finding the arcs take at most <em>O</em>(log<em>d</em>)
    15271550    ///amortized time, specifically, the time complexity of the lookups
    15281551    ///is equal to the optimal search tree implementation for the
    15291552    ///current query distribution in a constant factor.
    15301553    ///
    15311554    ///\note This is a dynamic data structure, therefore the data
    1532     ///structure is updated after each graph alteration. However,
    1533     ///theoretically this data structure is faster than \c ArcLookUp
    1534     ///or AllEdgeLookup, but it often provides worse performance than
     1555    ///structure is updated after each graph alteration. Thus although
     1556    ///this data structure is theoretically faster than \ref ArcLookUp
     1557    ///and \ref AllArcLookup, it often provides worse performance than
    15351558    ///them.
    1536     ///
    15371559    Arc operator()(Node s, Node t, Arc p = INVALID) const  {
    15381560      if (p == INVALID) {
    15391561        Arc a = _head[s];
     
    15851607
    15861608  };
    15871609
    1588   ///Fast arc look up between given endpoints.
     1610  ///Fast arc look-up between given endpoints.
    15891611
    15901612  ///Using this class, you can find an arc in a digraph from a given
    1591   ///source to a given target in time <em>O(log d)</em>,
     1613  ///source to a given target in time <em>O</em>(log<em>d</em>),
    15921614  ///where <em>d</em> is the out-degree of the source node.
    15931615  ///
    15941616  ///It is not possible to find \e all parallel arcs between two nodes.
    15951617  ///Use \ref AllArcLookUp for this purpose.
    15961618  ///
    1597   ///\warning This class is static, so you should refresh() (or at least
    1598   ///refresh(Node)) this data structure
    1599   ///whenever the digraph changes. This is a time consuming (superlinearly
    1600   ///proportional (<em>O(m</em>log<em>m)</em>) to the number of arcs).
     1619  ///\warning This class is static, so you should call refresh() (or at
     1620  ///least refresh(Node)) to refresh this data structure whenever the
     1621  ///digraph changes. This is a time consuming (superlinearly proportional
     1622  ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs).
    16011623  ///
    16021624  ///\tparam G The type of the underlying digraph.
    16031625  ///
     
    16461668      return me;
    16471669    }
    16481670  public:
    1649     ///Refresh the data structure at a node.
     1671    ///Refresh the search data structure at a node.
    16501672
    16511673    ///Build up the search database of node \c n.
    16521674    ///
    1653     ///It runs in time <em>O(d</em>log<em>d)</em>, where <em>d</em> is
    1654     ///the number of the outgoing arcs of \c n.
     1675    ///It runs in time <em>O</em>(<em>d</em> log<em>d</em>), where <em>d</em>
     1676    ///is the number of the outgoing arcs of \c n.
    16551677    void refresh(Node n)
    16561678    {
    16571679      std::vector<Arc> v;
     
    16671689    ///Build up the full search database. In fact, it simply calls
    16681690    ///\ref refresh(Node) "refresh(n)" for each node \c n.
    16691691    ///
    1670     ///It runs in time <em>O(m</em>log<em>D)</em>, where <em>m</em> is
    1671     ///the number of the arcs of \c n and <em>D</em> is the maximum
     1692    ///It runs in time <em>O</em>(<em>m</em> log<em>D</em>), where <em>m</em> is
     1693    ///the number of the arcs in the digraph and <em>D</em> is the maximum
    16721694    ///out-degree of the digraph.
    1673 
    16741695    void refresh()
    16751696    {
    16761697      for(NodeIt n(_g);n!=INVALID;++n) refresh(n);
     
    16781699
    16791700    ///Find an arc between two nodes.
    16801701
    1681     ///Find an arc between two nodes in time <em>O(</em>log<em>d)</em>, where
    1682     /// <em>d</em> is the number of outgoing arcs of \c s.
    1683     ///\param s The source node
    1684     ///\param t The target node
     1702    ///Find an arc between two nodes in time <em>O</em>(log<em>d</em>), where
     1703    ///<em>d</em> is the number of outgoing arcs of \c s.
     1704    ///\param s The source node.
     1705    ///\param t The target node.
    16851706    ///\return An arc from \c s to \c t if there exists,
    16861707    ///\ref INVALID otherwise.
    16871708    ///
    16881709    ///\warning If you change the digraph, refresh() must be called before using
    16891710    ///this operator. If you change the outgoing arcs of
    1690     ///a single node \c n, then
    1691     ///\ref refresh(Node) "refresh(n)" is enough.
    1692     ///
     1711    ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
    16931712    Arc operator()(Node s, Node t) const
    16941713    {
    16951714      Arc e;
     
    17011720
    17021721  };
    17031722
    1704   ///Fast look up of all arcs between given endpoints.
     1723  ///Fast look-up of all arcs between given endpoints.
    17051724
    17061725  ///This class is the same as \ref ArcLookUp, with the addition
    1707   ///that it makes it possible to find all arcs between given endpoints.
     1726  ///that it makes it possible to find all parallel arcs between given
     1727  ///endpoints.
    17081728  ///
    1709   ///\warning This class is static, so you should refresh() (or at least
    1710   ///refresh(Node)) this data structure
    1711   ///whenever the digraph changes. This is a time consuming (superlinearly
    1712   ///proportional (<em>O(m</em>log<em>m)</em>) to the number of arcs).
     1729  ///\warning This class is static, so you should call refresh() (or at
     1730  ///least refresh(Node)) to refresh this data structure whenever the
     1731  ///digraph changes. This is a time consuming (superlinearly proportional
     1732  ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs).
    17131733  ///
    17141734  ///\tparam G The type of the underlying digraph.
    17151735  ///
     
    17331753      if(head==INVALID) return next;
    17341754      else {
    17351755        next=refreshNext(_right[head],next);
    1736 //         _next[head]=next;
    17371756        _next[head]=( next!=INVALID && _g.target(next)==_g.target(head))
    17381757          ? next : INVALID;
    17391758        return refreshNext(_left[head],head);
     
    17581777
    17591778    ///Build up the search database of node \c n.
    17601779    ///
    1761     ///It runs in time <em>O(d</em>log<em>d)</em>, where <em>d</em> is
     1780    ///It runs in time <em>O</em>(<em>d</em> log<em>d</em>), where <em>d</em> is
    17621781    ///the number of the outgoing arcs of \c n.
    1763 
    17641782    void refresh(Node n)
    17651783    {
    17661784      ArcLookUp<G>::refresh(n);
     
    17721790    ///Build up the full search database. In fact, it simply calls
    17731791    ///\ref refresh(Node) "refresh(n)" for each node \c n.
    17741792    ///
    1775     ///It runs in time <em>O(m</em>log<em>D)</em>, where <em>m</em> is
    1776     ///the number of the arcs of \c n and <em>D</em> is the maximum
     1793    ///It runs in time <em>O</em>(<em>m</em> log<em>D</em>), where <em>m</em> is
     1794    ///the number of the arcs in the digraph and <em>D</em> is the maximum
    17771795    ///out-degree of the digraph.
    1778 
    17791796    void refresh()
    17801797    {
    17811798      for(NodeIt n(_g);n!=INVALID;++n) refresh(_head[n]);
     
    17841801    ///Find an arc between two nodes.
    17851802
    17861803    ///Find an arc between two nodes.
    1787     ///\param s The source node
    1788     ///\param t The target node
     1804    ///\param s The source node.
     1805    ///\param t The target node.
    17891806    ///\param prev The previous arc between \c s and \c t. It it is INVALID or
    17901807    ///not given, the operator finds the first appropriate arc.
    17911808    ///\return An arc from \c s to \c t after \c prev or
     
    17961813    ///\code
    17971814    ///AllArcLookUp<ListDigraph> ae(g);
    17981815    ///...
    1799     ///int n=0;
    1800     ///for(Arc e=ae(u,v);e!=INVALID;e=ae(u,v,e)) n++;
     1816    ///int n = 0;
     1817    ///for(Arc a = ae(u,v); a != INVALID; a=ae(u,v,a)) n++;
    18011818    ///\endcode
    18021819    ///
    1803     ///Finding the first arc take <em>O(</em>log<em>d)</em> time, where
    1804     /// <em>d</em> is the number of outgoing arcs of \c s. Then, the
     1820    ///Finding the first arc take <em>O</em>(log<em>d</em>) time, where
     1821    ///<em>d</em> is the number of outgoing arcs of \c s. Then, the
    18051822    ///consecutive arcs are found in constant time.
    18061823    ///
    18071824    ///\warning If you change the digraph, refresh() must be called before using
    18081825    ///this operator. If you change the outgoing arcs of
    1809     ///a single node \c n, then
    1810     ///\ref refresh(Node) "refresh(n)" is enough.
     1826    ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
    18111827    ///
    18121828#ifdef DOXYGEN
    18131829    Arc operator()(Node s, Node t, Arc prev=INVALID) const {}
  • test/graph_copy_test.cc

    diff --git a/test/graph_copy_test.cc b/test/graph_copy_test.cc
    a b  
    2626using namespace std;
    2727using namespace lemon;
    2828
    29 void digraph_copy_test() {
     29void copy_digraph_test() {
    3030  const int nn = 10;
    3131
    3232  SmartDigraph from;
     
    6363  ListDigraph::NodeMap<SmartDigraph::Node> ncr(to);
    6464  ListDigraph::ArcMap<SmartDigraph::Arc> ecr(to);
    6565
    66   DigraphCopy<ListDigraph, SmartDigraph>(to, from).
     66  CopyDigraph<ListDigraph, SmartDigraph>(to, from).
    6767    nodeMap(tnm, fnm).arcMap(tam, fam).
    6868    nodeRef(nr).arcRef(er).
    6969    nodeCrossRef(ncr).arcCrossRef(ecr).
     
    9292  check(ta == er[fa], "Wrong copy.");
    9393}
    9494
    95 void graph_copy_test() {
     95void copy_graph_test() {
    9696  const int nn = 10;
    9797
    9898  SmartGraph from;
     
    138138  ListGraph::ArcMap<SmartGraph::Arc> acr(to);
    139139  ListGraph::EdgeMap<SmartGraph::Edge> ecr(to);
    140140
    141   GraphCopy<ListGraph, SmartGraph>(to, from).
     141  CopyGraph<ListGraph, SmartGraph>(to, from).
    142142    nodeMap(tnm, fnm).arcMap(tam, fam).edgeMap(tem, fem).
    143143    nodeRef(nr).arcRef(ar).edgeRef(er).
    144144    nodeCrossRef(ncr).arcCrossRef(acr).edgeCrossRef(ecr).
     
    184184
    185185
    186186int main() {
    187   digraph_copy_test();
    188   graph_copy_test();
     187  copy_digraph_test();
     188  copy_graph_test();
    189189
    190190  return 0;
    191191}