My Project
Loading...
Searching...
No Matches
List of all members | Public Member Functions
BpGraphCopy< From, To > Class Template Reference

Detailed Description

template<typename From, typename To>
class lemon::BpGraphCopy< From, To >

Class to copy a bipartite graph to another graph (duplicate a graph). The simplest way of using it is through the bpGraphCopy() function.

This class not only make a copy of a bipartite graph, but it can create references and cross references between the nodes, edges and arcs of the two graphs, and it can copy maps for using with the newly created graph.

To make a copy from a graph, first an instance of BpGraphCopy should be created, then the data belongs to the graph should assigned to copy. In the end, the run() member should be called.

The next code copies a graph with several data:

BpGraphCopy<OrigBpGraph, NewBpGraph> cg(orig_graph, new_graph);
// Create references for the nodes
OrigBpGraph::NodeMap<NewBpGraph::Node> nr(orig_graph);
cg.nodeRef(nr);
// Create cross references (inverse) for the edges
NewBpGraph::EdgeMap<OrigBpGraph::Edge> ecr(new_graph);
cg.edgeCrossRef(ecr);
// Copy a red node map
OrigBpGraph::RedNodeMap<double> ormap(orig_graph);
NewBpGraph::RedNodeMap<double> nrmap(new_graph);
cg.redNodeMap(ormap, nrmap);
// Copy a node
OrigBpGraph::Node on;
NewBpGraph::Node nn;
cg.node(on, nn);
// Execute copying
cg.run();
Class to copy a bipartite graph.
Definition core.h:1191

#include <lemon/core.h>

Public Member Functions

 BpGraphCopy (const From &from, To &to)
 Constructor of BpGraphCopy.
 
 ~BpGraphCopy ()
 Destructor of BpGraphCopy.
 
template<typename NodeRef >
BpGraphCopynodeRef (NodeRef &map)
 Copy the node references into the given map.
 
template<typename NodeCrossRef >
BpGraphCopynodeCrossRef (NodeCrossRef &map)
 Copy the node cross references into the given map.
 
template<typename FromMap , typename ToMap >
BpGraphCopynodeMap (const FromMap &map, ToMap &tmap)
 Make a copy of the given node map.
 
BpGraphCopynode (const Node &node, TNode &tnode)
 Make a copy of the given node.
 
template<typename RedRef >
BpGraphCopyredRef (RedRef &map)
 Copy the red node references into the given map.
 
template<typename RedCrossRef >
BpGraphCopyredCrossRef (RedCrossRef &map)
 Copy the red node cross references into the given map.
 
template<typename FromMap , typename ToMap >
BpGraphCopyredNodeMap (const FromMap &map, ToMap &tmap)
 Make a copy of the given red node map.
 
BpGraphCopyredNode (const RedNode &node, TRedNode &tnode)
 Make a copy of the given red node.
 
template<typename BlueRef >
BpGraphCopyblueRef (BlueRef &map)
 Copy the blue node references into the given map.
 
template<typename BlueCrossRef >
BpGraphCopyblueCrossRef (BlueCrossRef &map)
 Copy the blue node cross references into the given map.
 
template<typename FromMap , typename ToMap >
BpGraphCopyblueNodeMap (const FromMap &map, ToMap &tmap)
 Make a copy of the given blue node map.
 
BpGraphCopyblueNode (const BlueNode &node, TBlueNode &tnode)
 Make a copy of the given blue node.
 
template<typename ArcRef >
BpGraphCopyarcRef (ArcRef &map)
 Copy the arc references into the given map.
 
template<typename ArcCrossRef >
BpGraphCopyarcCrossRef (ArcCrossRef &map)
 Copy the arc cross references into the given map.
 
template<typename FromMap , typename ToMap >
BpGraphCopyarcMap (const FromMap &map, ToMap &tmap)
 Make a copy of the given arc map.
 
BpGraphCopyarc (const Arc &arc, TArc &tarc)
 Make a copy of the given arc.
 
template<typename EdgeRef >
BpGraphCopyedgeRef (EdgeRef &map)
 Copy the edge references into the given map.
 
template<typename EdgeCrossRef >
BpGraphCopyedgeCrossRef (EdgeCrossRef &map)
 Copy the edge cross references into the given map.
 
template<typename FromMap , typename ToMap >
BpGraphCopyedgeMap (const FromMap &map, ToMap &tmap)
 Make a copy of the given edge map.
 
BpGraphCopyedge (const Edge &edge, TEdge &tedge)
 Make a copy of the given edge.
 
void run ()
 Execute copying.
 

Constructor & Destructor Documentation

◆ BpGraphCopy()

template<typename From , typename To >
BpGraphCopy ( const From &  from,
To &  to 
)
inline

Constructor of BpGraphCopy for copying the content of the from graph into the to graph.

◆ ~BpGraphCopy()

template<typename From , typename To >
~BpGraphCopy ( )
inline

Destructor of BpGraphCopy.

Member Function Documentation

◆ nodeRef()

template<typename From , typename To >
template<typename NodeRef >
BpGraphCopy & nodeRef ( NodeRef &  map)
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 graph, while the value type is the Node type of the destination graph.

◆ nodeCrossRef()

template<typename From , typename To >
template<typename NodeCrossRef >
BpGraphCopy & nodeCrossRef ( NodeCrossRef &  map)
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 graph, while the value type is the Node type of the source graph.

◆ nodeMap()

template<typename From , typename To >
template<typename FromMap , typename ToMap >
BpGraphCopy & nodeMap ( const FromMap &  map,
ToMap &  tmap 
)
inline

This function makes a copy of the given node map for the newly created graph. The key type of the new map tmap should be the Node type of the destination graph, and the key type of the original map map should be the Node type of the source graph.

◆ node()

template<typename From , typename To >
BpGraphCopy & node ( const Node &  node,
TNode &  tnode 
)
inline

This function makes a copy of the given node.

◆ redRef()

template<typename From , typename To >
template<typename RedRef >
BpGraphCopy & redRef ( RedRef &  map)
inline

This function copies the red node references into the given map. The parameter should be a map, whose key type is the Node type of the source graph with the red item set, while the value type is the Node type of the destination graph.

◆ redCrossRef()

template<typename From , typename To >
template<typename RedCrossRef >
BpGraphCopy & redCrossRef ( RedCrossRef &  map)
inline

This function copies the red 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 graph with the red item set, while the value type is the Node type of the source graph.

◆ redNodeMap()

template<typename From , typename To >
template<typename FromMap , typename ToMap >
BpGraphCopy & redNodeMap ( const FromMap &  map,
ToMap &  tmap 
)
inline

This function makes a copy of the given red node map for the newly created graph. The key type of the new map tmap should be the Node type of the destination graph with the red items, and the key type of the original map map should be the Node type of the source graph.

◆ redNode()

template<typename From , typename To >
BpGraphCopy & redNode ( const RedNode &  node,
TRedNode &  tnode 
)
inline

This function makes a copy of the given red node.

◆ blueRef()

template<typename From , typename To >
template<typename BlueRef >
BpGraphCopy & blueRef ( BlueRef &  map)
inline

This function copies the blue node references into the given map. The parameter should be a map, whose key type is the Node type of the source graph with the blue item set, while the value type is the Node type of the destination graph.

◆ blueCrossRef()

template<typename From , typename To >
template<typename BlueCrossRef >
BpGraphCopy & blueCrossRef ( BlueCrossRef &  map)
inline

This function copies the blue 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 graph with the blue item set, while the value type is the Node type of the source graph.

◆ blueNodeMap()

template<typename From , typename To >
template<typename FromMap , typename ToMap >
BpGraphCopy & blueNodeMap ( const FromMap &  map,
ToMap &  tmap 
)
inline

This function makes a copy of the given blue node map for the newly created graph. The key type of the new map tmap should be the Node type of the destination graph with the blue items, and the key type of the original map map should be the Node type of the source graph.

◆ blueNode()

template<typename From , typename To >
BpGraphCopy & blueNode ( const BlueNode &  node,
TBlueNode &  tnode 
)
inline

This function makes a copy of the given blue node.

◆ arcRef()

template<typename From , typename To >
template<typename ArcRef >
BpGraphCopy & arcRef ( ArcRef &  map)
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 graph, while the value type is the Arc type of the destination graph.

◆ arcCrossRef()

template<typename From , typename To >
template<typename ArcCrossRef >
BpGraphCopy & arcCrossRef ( ArcCrossRef &  map)
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 graph, while the value type is the Arc type of the source graph.

◆ arcMap()

template<typename From , typename To >
template<typename FromMap , typename ToMap >
BpGraphCopy & arcMap ( const FromMap &  map,
ToMap &  tmap 
)
inline

This function makes a copy of the given arc map for the newly created graph. The key type of the new map tmap should be the Arc type of the destination graph, and the key type of the original map map should be the Arc type of the source graph.

◆ arc()

template<typename From , typename To >
BpGraphCopy & arc ( const Arc &  arc,
TArc &  tarc 
)
inline

This function makes a copy of the given arc.

◆ edgeRef()

template<typename From , typename To >
template<typename EdgeRef >
BpGraphCopy & edgeRef ( EdgeRef &  map)
inline

This function copies the edge references into the given map. The parameter should be a map, whose key type is the Edge type of the source graph, while the value type is the Edge type of the destination graph.

◆ edgeCrossRef()

template<typename From , typename To >
template<typename EdgeCrossRef >
BpGraphCopy & edgeCrossRef ( EdgeCrossRef &  map)
inline

This function copies the edge cross references (reverse references) into the given map. The parameter should be a map, whose key type is the Edge type of the destination graph, while the value type is the Edge type of the source graph.

◆ edgeMap()

template<typename From , typename To >
template<typename FromMap , typename ToMap >
BpGraphCopy & edgeMap ( const FromMap &  map,
ToMap &  tmap 
)
inline

This function makes a copy of the given edge map for the newly created graph. The key type of the new map tmap should be the Edge type of the destination graph, and the key type of the original map map should be the Edge type of the source graph.

◆ edge()

template<typename From , typename To >
BpGraphCopy & edge ( const Edge &  edge,
TEdge &  tedge 
)
inline

This function makes a copy of the given edge.

◆ run()

template<typename From , typename To >
void run ( )
inline

This function executes the copying of the graph along with the copying of the assigned data.