Class to copy a digraph to another digraph (duplicate a digraph). The simplest way of using it is through the digraphCopy()
function.
This class not only make a copy of a digraph, but it can create references and cross references between the nodes and arcs of the two digraphs, and it can copy maps to use with the newly created digraph.
To make a copy from a digraph, first an instance of DigraphCopy should be created, then the data belongs to the digraph should assigned to copy. In the end, the run()
member should be called.
The next code copies a digraph with several data:
#include <lemon/core.h>
Public Member Functions | |
DigraphCopy (const From &from, To &to) | |
Constructor of DigraphCopy. More... | |
~DigraphCopy () | |
Destructor of DigraphCopy. More... | |
template<typename NodeRef > | |
DigraphCopy & | nodeRef (NodeRef &map) |
Copy the node references into the given map. More... | |
template<typename NodeCrossRef > | |
DigraphCopy & | nodeCrossRef (NodeCrossRef &map) |
Copy the node cross references into the given map. More... | |
template<typename FromMap , typename ToMap > | |
DigraphCopy & | nodeMap (const FromMap &map, ToMap &tmap) |
Make a copy of the given node map. More... | |
DigraphCopy & | node (const Node &node, TNode &tnode) |
Make a copy of the given node. More... | |
template<typename ArcRef > | |
DigraphCopy & | arcRef (ArcRef &map) |
Copy the arc references into the given map. More... | |
template<typename ArcCrossRef > | |
DigraphCopy & | arcCrossRef (ArcCrossRef &map) |
Copy the arc cross references into the given map. More... | |
template<typename FromMap , typename ToMap > | |
DigraphCopy & | arcMap (const FromMap &map, ToMap &tmap) |
Make a copy of the given arc map. More... | |
DigraphCopy & | arc (const Arc &arc, TArc &tarc) |
Make a copy of the given arc. More... | |
void | run () |
Execute copying. More... | |
|
inline |
Constructor of DigraphCopy for copying the content of the from
digraph into the to
digraph.
|
inline |
Destructor of DigraphCopy.
|
inline |
This function copies the node references into the given map. The parameter should be a map, whose key type is the Node type of the source digraph, while the value type is the Node type of the destination digraph.
|
inline |
This function copies the node cross references (reverse references) into the given map. The parameter should be a map, whose key type is the Node type of the destination digraph, while the value type is the Node type of the source digraph.
|
inline |
This function makes a copy of the given node map for the newly created digraph. The key type of the new map tmap
should be the Node type of the destination digraph, and the key type of the original map map
should be the Node type of the source digraph.
|
inline |
This function makes a copy of the given node.
|
inline |
This function copies the arc references into the given map. The parameter should be a map, whose key type is the Arc type of the source digraph, while the value type is the Arc type of the destination digraph.
|
inline |
This function copies the arc cross references (reverse references) into the given map. The parameter should be a map, whose key type is the Arc type of the destination digraph, while the value type is the Arc type of the source digraph.
|
inline |
This function makes a copy of the given arc map for the newly created digraph. The key type of the new map tmap
should be the Arc type of the destination digraph, and the key type of the original map map
should be the Arc type of the source digraph.
|
inline |
This function makes a copy of the given arc.
|
inline |
This function executes the copying of the digraph along with the copying of the assigned data.