template<typename From, typename To>
class lemon::DigraphCopy< From, To >
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:
DigraphCopy<OrigGraph, NewGraph> cg(orig_graph, new_graph);
OrigGraph::NodeMap<NewGraph::Node> nr(orig_graph);
cg.nodeRef(nr);
NewGraph::ArcMap<OrigGraph::Arc> acr(new_graph);
cg.arcCrossRef(acr);
OrigGraph::ArcMap<double> oamap(orig_graph);
NewGraph::ArcMap<double> namap(new_graph);
cg.arcMap(oamap, namap);
OrigGraph::Node on;
NewGraph::Node nn;
cg.node(on, nn);
cg.run();
|
| DigraphCopy (const From &from, To &to) |
| Constructor of DigraphCopy.
|
|
| ~DigraphCopy () |
|
template<typename NodeRef > |
DigraphCopy & | nodeRef (NodeRef &map) |
| Copy the node references into the given map.
|
|
template<typename NodeCrossRef > |
DigraphCopy & | nodeCrossRef (NodeCrossRef &map) |
| Copy the node cross references into the given map.
|
|
template<typename FromMap , typename ToMap > |
DigraphCopy & | nodeMap (const FromMap &map, ToMap &tmap) |
| Make a copy of the given node map.
|
|
DigraphCopy & | node (const Node &node, TNode &tnode) |
| Make a copy of the given node.
|
|
template<typename ArcRef > |
DigraphCopy & | arcRef (ArcRef &map) |
| Copy the arc references into the given map.
|
|
template<typename ArcCrossRef > |
DigraphCopy & | arcCrossRef (ArcCrossRef &map) |
| Copy the arc cross references into the given map.
|
|
template<typename FromMap , typename ToMap > |
DigraphCopy & | arcMap (const FromMap &map, ToMap &tmap) |
| Make a copy of the given arc map.
|
|
DigraphCopy & | arc (const Arc &arc, TArc &tarc) |
| Make a copy of the given arc.
|
|
void | run () |
| Execute copying.
|
|