[Lemon-commits] deba: r3325 - in lemon/trunk: doc lemon lemon/concepts
Lemon SVN
svn at lemon.cs.elte.hu
Tue Oct 2 14:34:44 CEST 2007
Author: deba
Date: Tue Oct 2 14:34:43 2007
New Revision: 3325
Added:
lemon/trunk/doc/developers.dox
Modified:
lemon/trunk/doc/Makefile.am
lemon/trunk/lemon/concepts/bpugraph.h
lemon/trunk/lemon/concepts/graph.h
lemon/trunk/lemon/concepts/graph_components.h
lemon/trunk/lemon/concepts/ugraph.h
lemon/trunk/lemon/graph_utils.h
Log:
New developers page
The participation period should be included
Bug fix in doc related to Graph concpets
Removing some todos!
Modified: lemon/trunk/doc/Makefile.am
==============================================================================
--- lemon/trunk/doc/Makefile.am (original)
+++ lemon/trunk/doc/Makefile.am Tue Oct 2 14:34:43 2007
@@ -10,6 +10,7 @@
doc/algorithms.dox \
doc/coding_style.dox \
doc/developers_interface.dox \
+ doc/developres.dox \
doc/dirs.dox \
doc/getstart.dox \
doc/graph-adaptors.dox \
Added: lemon/trunk/doc/developers.dox
==============================================================================
--- (empty file)
+++ lemon/trunk/doc/developers.dox Tue Oct 2 14:34:43 2007
@@ -0,0 +1,41 @@
+/* -*- C++ -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library
+ *
+ * Copyright (C) 2003-2007
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+namespace lemon {
+/*!
+
+
+\page developers LEMON Developers
+
+\li Mihaly Barasz
+\li Johanna Becker
+\li Attila Bernath
+\li Balazs Dezso
+\li Peter Hegyi
+\li Alpar Juttner
+\li Peter Kovacs
+\li Akos Ladanyi
+\li Marton Makai
+\li Balazs Attila Mihaly
+\li Janos Nagy
+\li Jacint Szabo
+\li Zsuzsanna Vaik
+
+*/
+}
+
Modified: lemon/trunk/lemon/concepts/bpugraph.h
==============================================================================
--- lemon/trunk/lemon/concepts/bpugraph.h (original)
+++ lemon/trunk/lemon/concepts/bpugraph.h Tue Oct 2 14:34:43 2007
@@ -33,8 +33,7 @@
namespace lemon {
namespace concepts {
- /// \addtogroup graph_concepts
- /// @{
+ /// \ingroup graph_concepts
///
/// \brief Class describing the concept of Bipartite Undirected Graphs.
///
@@ -998,9 +997,6 @@
};
-
- /// @}
-
}
}
Modified: lemon/trunk/lemon/concepts/graph.h
==============================================================================
--- lemon/trunk/lemon/concepts/graph.h (original)
+++ lemon/trunk/lemon/concepts/graph.h Tue Oct 2 14:34:43 2007
@@ -32,8 +32,7 @@
namespace lemon {
namespace concepts {
- /// \addtogroup graph_concepts
- /// @{
+ /// \ingroup graph_concepts
///
/// \brief Class describing the concept of Directed Graphs.
///
@@ -446,7 +445,6 @@
};
- // @}
} //namespace concepts
} //namespace lemon
Modified: lemon/trunk/lemon/concepts/graph_components.h
==============================================================================
--- lemon/trunk/lemon/concepts/graph_components.h (original)
+++ lemon/trunk/lemon/concepts/graph_components.h Tue Oct 2 14:34:43 2007
@@ -1482,15 +1482,12 @@
///
template <typename _Value>
class NodeMap : public GraphMap<Graph, Node, _Value> {
- private:
- NodeMap();
public:
typedef GraphMap<MappableGraphComponent, Node, _Value> Parent;
/// \brief Construct a new map.
///
/// Construct a new map for the graph.
- /// \todo call the right parent class constructor
explicit NodeMap(const MappableGraphComponent& graph)
: Parent(graph) {}
@@ -1522,15 +1519,12 @@
///
template <typename _Value>
class EdgeMap : public GraphMap<Graph, Edge, _Value> {
- private:
- EdgeMap();
public:
typedef GraphMap<MappableGraphComponent, Edge, _Value> Parent;
/// \brief Construct a new map.
///
/// Construct a new map for the graph.
- /// \todo call the right parent class constructor
explicit EdgeMap(const MappableGraphComponent& graph)
: Parent(graph) {}
@@ -1627,7 +1621,6 @@
/// \brief Construct a new map.
///
/// Construct a new map for the graph.
- /// \todo call the right parent class constructor
explicit UEdgeMap(const MappableUGraphComponent& graph)
: Parent(graph) {}
@@ -1712,7 +1705,6 @@
/// \brief Construct a new map.
///
/// Construct a new map for the graph.
- /// \todo call the right parent class constructor
explicit ANodeMap(const MappableBpUGraphComponent& graph)
: Parent(graph) {}
@@ -1750,7 +1742,6 @@
/// \brief Construct a new map.
///
/// Construct a new map for the graph.
- /// \todo call the right parent class constructor
explicit BNodeMap(const MappableBpUGraphComponent& graph)
: Parent(graph) {}
Modified: lemon/trunk/lemon/concepts/ugraph.h
==============================================================================
--- lemon/trunk/lemon/concepts/ugraph.h (original)
+++ lemon/trunk/lemon/concepts/ugraph.h Tue Oct 2 14:34:43 2007
@@ -30,8 +30,7 @@
namespace lemon {
namespace concepts {
- /// \addtogroup graph_concepts
- /// @{
+ /// \ingroup graph_concepts
///
/// \brief Class describing the concept of Undirected Graphs.
///
@@ -696,8 +695,6 @@
};
- /// @}
-
}
}
Modified: lemon/trunk/lemon/graph_utils.h
==============================================================================
--- lemon/trunk/lemon/graph_utils.h (original)
+++ lemon/trunk/lemon/graph_utils.h Tue Oct 2 14:34:43 2007
@@ -146,8 +146,9 @@
/// The complexity of the function is O(n) but for some
/// graph structures it is specialized to run in O(1).
///
- /// \todo Refer how to specialize it.
-
+ /// If the graph contains a \e nodeNum() member function and a
+ /// \e NodeNumTag tag then this function calls directly the member
+ /// function to query the cardinality of the node set.
template <typename Graph>
inline int countNodes(const Graph& g) {
return _graph_utils_bits::CountNodesSelector<Graph>::count(g);
@@ -179,8 +180,9 @@
/// The complexity of the function is O(an) but for some
/// graph structures it is specialized to run in O(1).
///
- /// \todo Refer how to specialize it.
-
+ /// If the graph contains an \e aNodeNum() member function and a
+ /// \e NodeNumTag tag then this function calls directly the member
+ /// function to query the cardinality of the A-node set.
template <typename Graph>
inline int countANodes(const Graph& g) {
return _graph_utils_bits::CountANodesSelector<Graph>::count(g);
@@ -212,8 +214,9 @@
/// The complexity of the function is O(bn) but for some
/// graph structures it is specialized to run in O(1).
///
- /// \todo Refer how to specialize it.
-
+ /// If the graph contains a \e bNodeNum() member function and a
+ /// \e NodeNumTag tag then this function calls directly the member
+ /// function to query the cardinality of the B-node set.
template <typename Graph>
inline int countBNodes(const Graph& g) {
return _graph_utils_bits::CountBNodesSelector<Graph>::count(g);
@@ -247,7 +250,10 @@
/// This function counts the edges in the graph.
/// The complexity of the function is O(e) but for some
/// graph structures it is specialized to run in O(1).
-
+ ///
+ /// If the graph contains a \e edgeNum() member function and a
+ /// \e EdgeNumTag tag then this function calls directly the member
+ /// function to query the cardinality of the edge set.
template <typename Graph>
inline int countEdges(const Graph& g) {
return _graph_utils_bits::CountEdgesSelector<Graph>::count(g);
@@ -279,7 +285,10 @@
/// This function counts the undirected edges in the graph.
/// The complexity of the function is O(e) but for some
/// graph structures it is specialized to run in O(1).
-
+ ///
+ /// If the graph contains a \e uEdgeNum() member function and a
+ /// \e EdgeNumTag tag then this function calls directly the member
+ /// function to query the cardinality of the undirected edge set.
template <typename Graph>
inline int countUEdges(const Graph& g) {
return _graph_utils_bits::CountUEdgesSelector<Graph>::count(g);
@@ -559,26 +568,26 @@
/// \brief Copy a map.
///
- /// This function copies the \c source map to the \c target map. It uses the
+ /// This function copies the \c from map to the \c to map. It uses the
/// given iterator to iterate on the data structure and it uses the \c ref
- /// mapping to convert the source's keys to the target's keys.
- template <typename Target, typename Source,
+ /// mapping to convert the from's keys to the to's keys.
+ template <typename To, typename From,
typename ItemIt, typename Ref>
- void copyMap(Target& target, const Source& source,
+ void copyMap(To& to, const From& from,
ItemIt it, const Ref& ref) {
for (; it != INVALID; ++it) {
- target[ref[it]] = source[it];
+ to[ref[it]] = from[it];
}
}
- /// \brief Copy the source map to the target map.
+ /// \brief Copy the from map to the to map.
///
- /// Copy the \c source map to the \c target map. It uses the given iterator
+ /// Copy the \c from map to the \c to map. It uses the given iterator
/// to iterate on the data structure.
- template <typename Target, typename Source, typename ItemIt>
- void copyMap(Target& target, const Source& source, ItemIt it) {
+ template <typename To, typename From, typename ItemIt>
+ void copyMap(To& to, const From& from, ItemIt it) {
for (; it != INVALID; ++it) {
- target[it] = source[it];
+ to[it] = from[it];
}
}
@@ -587,17 +596,17 @@
template <typename Graph, typename Item, typename RefMap>
class MapCopyBase {
public:
- virtual void copy(const Graph& source, const RefMap& refMap) = 0;
+ virtual void copy(const Graph& from, const RefMap& refMap) = 0;
virtual ~MapCopyBase() {}
};
template <typename Graph, typename Item, typename RefMap,
- typename TargetMap, typename SourceMap>
+ typename ToMap, typename FromMap>
class MapCopy : public MapCopyBase<Graph, Item, RefMap> {
public:
- MapCopy(TargetMap& tmap, const SourceMap& map)
+ MapCopy(ToMap& tmap, const FromMap& map)
: _tmap(tmap), _map(map) {}
virtual void copy(const Graph& graph, const RefMap& refMap) {
@@ -608,8 +617,8 @@
}
private:
- TargetMap& _tmap;
- const SourceMap& _map;
+ ToMap& _tmap;
+ const FromMap& _map;
};
template <typename Graph, typename Item, typename RefMap, typename It>
@@ -664,15 +673,15 @@
template <typename Graph, typename Enable = void>
struct GraphCopySelector {
- template <typename Source, typename NodeRefMap, typename EdgeRefMap>
- static void copy(Graph &target, const Source& source,
+ template <typename From, typename NodeRefMap, typename EdgeRefMap>
+ static void copy(Graph &to, const From& from,
NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
- for (typename Source::NodeIt it(source); it != INVALID; ++it) {
- nodeRefMap[it] = target.addNode();
+ for (typename From::NodeIt it(from); it != INVALID; ++it) {
+ nodeRefMap[it] = to.addNode();
}
- for (typename Source::EdgeIt it(source); it != INVALID; ++it) {
- edgeRefMap[it] = target.addEdge(nodeRefMap[source.source(it)],
- nodeRefMap[source.target(it)]);
+ for (typename From::EdgeIt it(from); it != INVALID; ++it) {
+ edgeRefMap[it] = to.addEdge(nodeRefMap[from.source(it)],
+ nodeRefMap[from.target(it)]);
}
}
};
@@ -682,24 +691,24 @@
Graph,
typename enable_if<typename Graph::BuildTag, void>::type>
{
- template <typename Source, typename NodeRefMap, typename EdgeRefMap>
- static void copy(Graph &target, const Source& source,
+ template <typename From, typename NodeRefMap, typename EdgeRefMap>
+ static void copy(Graph &to, const From& from,
NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
- target.build(source, nodeRefMap, edgeRefMap);
+ to.build(from, nodeRefMap, edgeRefMap);
}
};
template <typename UGraph, typename Enable = void>
struct UGraphCopySelector {
- template <typename Source, typename NodeRefMap, typename UEdgeRefMap>
- static void copy(UGraph &target, const Source& source,
+ template <typename From, typename NodeRefMap, typename UEdgeRefMap>
+ static void copy(UGraph &to, const From& from,
NodeRefMap& nodeRefMap, UEdgeRefMap& uEdgeRefMap) {
- for (typename Source::NodeIt it(source); it != INVALID; ++it) {
- nodeRefMap[it] = target.addNode();
+ for (typename From::NodeIt it(from); it != INVALID; ++it) {
+ nodeRefMap[it] = to.addNode();
}
- for (typename Source::UEdgeIt it(source); it != INVALID; ++it) {
- uEdgeRefMap[it] = target.addEdge(nodeRefMap[source.source(it)],
- nodeRefMap[source.target(it)]);
+ for (typename From::UEdgeIt it(from); it != INVALID; ++it) {
+ uEdgeRefMap[it] = to.addEdge(nodeRefMap[from.source(it)],
+ nodeRefMap[from.target(it)]);
}
}
};
@@ -709,29 +718,29 @@
UGraph,
typename enable_if<typename UGraph::BuildTag, void>::type>
{
- template <typename Source, typename NodeRefMap, typename UEdgeRefMap>
- static void copy(UGraph &target, const Source& source,
+ template <typename From, typename NodeRefMap, typename UEdgeRefMap>
+ static void copy(UGraph &to, const From& from,
NodeRefMap& nodeRefMap, UEdgeRefMap& uEdgeRefMap) {
- target.build(source, nodeRefMap, uEdgeRefMap);
+ to.build(from, nodeRefMap, uEdgeRefMap);
}
};
template <typename BpUGraph, typename Enable = void>
struct BpUGraphCopySelector {
- template <typename Source, typename ANodeRefMap,
+ template <typename From, typename ANodeRefMap,
typename BNodeRefMap, typename UEdgeRefMap>
- static void copy(BpUGraph &target, const Source& source,
+ static void copy(BpUGraph &to, const From& from,
ANodeRefMap& aNodeRefMap, BNodeRefMap& bNodeRefMap,
UEdgeRefMap& uEdgeRefMap) {
- for (typename Source::ANodeIt it(source); it != INVALID; ++it) {
- aNodeRefMap[it] = target.addANode();
+ for (typename From::ANodeIt it(from); it != INVALID; ++it) {
+ aNodeRefMap[it] = to.addANode();
}
- for (typename Source::BNodeIt it(source); it != INVALID; ++it) {
- bNodeRefMap[it] = target.addBNode();
+ for (typename From::BNodeIt it(from); it != INVALID; ++it) {
+ bNodeRefMap[it] = to.addBNode();
}
- for (typename Source::UEdgeIt it(source); it != INVALID; ++it) {
- uEdgeRefMap[it] = target.addEdge(aNodeRefMap[source.aNode(it)],
- bNodeRefMap[source.bNode(it)]);
+ for (typename From::UEdgeIt it(from); it != INVALID; ++it) {
+ uEdgeRefMap[it] = to.addEdge(aNodeRefMap[from.aNode(it)],
+ bNodeRefMap[from.bNode(it)]);
}
}
};
@@ -741,12 +750,12 @@
BpUGraph,
typename enable_if<typename BpUGraph::BuildTag, void>::type>
{
- template <typename Source, typename ANodeRefMap,
+ template <typename From, typename ANodeRefMap,
typename BNodeRefMap, typename UEdgeRefMap>
- static void copy(BpUGraph &target, const Source& source,
+ static void copy(BpUGraph &to, const From& from,
ANodeRefMap& aNodeRefMap, BNodeRefMap& bNodeRefMap,
UEdgeRefMap& uEdgeRefMap) {
- target.build(source, aNodeRefMap, bNodeRefMap, uEdgeRefMap);
+ to.build(from, aNodeRefMap, bNodeRefMap, uEdgeRefMap);
}
};
@@ -757,20 +766,20 @@
///
/// Class to copy a graph to another graph (duplicate a graph). The
/// simplest way of using it is through the \c copyGraph() function.
- template <typename Target, typename Source>
+ template <typename To, typename From>
class GraphCopy {
private:
- typedef typename Source::Node Node;
- typedef typename Source::NodeIt NodeIt;
- typedef typename Source::Edge Edge;
- typedef typename Source::EdgeIt EdgeIt;
+ typedef typename From::Node Node;
+ typedef typename From::NodeIt NodeIt;
+ typedef typename From::Edge Edge;
+ typedef typename From::EdgeIt EdgeIt;
- typedef typename Target::Node TNode;
- typedef typename Target::Edge TEdge;
+ typedef typename To::Node TNode;
+ typedef typename To::Edge TEdge;
- typedef typename Source::template NodeMap<TNode> NodeRefMap;
- typedef typename Source::template EdgeMap<TEdge> EdgeRefMap;
+ typedef typename From::template NodeMap<TNode> NodeRefMap;
+ typedef typename From::template EdgeMap<TEdge> EdgeRefMap;
public:
@@ -778,10 +787,10 @@
/// \brief Constructor for the GraphCopy.
///
- /// It copies the content of the \c _source graph into the
- /// \c _target graph.
- GraphCopy(Target& _target, const Source& _source)
- : source(_source), target(_target) {}
+ /// It copies the content of the \c _from graph into the
+ /// \c _to graph.
+ GraphCopy(To& _to, const From& _from)
+ : from(_from), to(_to) {}
/// \brief Destructor of the GraphCopy
///
@@ -801,7 +810,7 @@
/// Copies the node references into the given map.
template <typename NodeRef>
GraphCopy& nodeRef(NodeRef& map) {
- nodeMapCopies.push_back(new _graph_utils_bits::RefCopy<Source, Node,
+ nodeMapCopies.push_back(new _graph_utils_bits::RefCopy<From, Node,
NodeRefMap, NodeRef>(map));
return *this;
}
@@ -812,7 +821,7 @@
/// the given map.
template <typename NodeCrossRef>
GraphCopy& nodeCrossRef(NodeCrossRef& map) {
- nodeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<Source, Node,
+ nodeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<From, Node,
NodeRefMap, NodeCrossRef>(map));
return *this;
}
@@ -820,13 +829,13 @@
/// \brief Make copy of the given map.
///
/// Makes copy of the given map for the newly created graph.
- /// The new map's key type is the target graph's node type,
- /// and the copied map's key type is the source graph's node
+ /// The new map's key type is the to graph's node type,
+ /// and the copied map's key type is the from graph's node
/// type.
- template <typename TargetMap, typename SourceMap>
- GraphCopy& nodeMap(TargetMap& tmap, const SourceMap& map) {
- nodeMapCopies.push_back(new _graph_utils_bits::MapCopy<Source, Node,
- NodeRefMap, TargetMap, SourceMap>(tmap, map));
+ template <typename ToMap, typename FromMap>
+ GraphCopy& nodeMap(ToMap& tmap, const FromMap& map) {
+ nodeMapCopies.push_back(new _graph_utils_bits::MapCopy<From, Node,
+ NodeRefMap, ToMap, FromMap>(tmap, map));
return *this;
}
@@ -834,7 +843,7 @@
///
/// Make a copy of the given node.
GraphCopy& node(TNode& tnode, const Node& snode) {
- nodeMapCopies.push_back(new _graph_utils_bits::ItemCopy<Source, Node,
+ nodeMapCopies.push_back(new _graph_utils_bits::ItemCopy<From, Node,
NodeRefMap, TNode>(tnode, snode));
return *this;
}
@@ -844,7 +853,7 @@
/// Copies the edge references into the given map.
template <typename EdgeRef>
GraphCopy& edgeRef(EdgeRef& map) {
- edgeMapCopies.push_back(new _graph_utils_bits::RefCopy<Source, Edge,
+ edgeMapCopies.push_back(new _graph_utils_bits::RefCopy<From, Edge,
EdgeRefMap, EdgeRef>(map));
return *this;
}
@@ -855,7 +864,7 @@
/// the given map.
template <typename EdgeCrossRef>
GraphCopy& edgeCrossRef(EdgeCrossRef& map) {
- edgeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<Source, Edge,
+ edgeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<From, Edge,
EdgeRefMap, EdgeCrossRef>(map));
return *this;
}
@@ -863,13 +872,13 @@
/// \brief Make copy of the given map.
///
/// Makes copy of the given map for the newly created graph.
- /// The new map's key type is the target graph's edge type,
- /// and the copied map's key type is the source graph's edge
+ /// The new map's key type is the to graph's edge type,
+ /// and the copied map's key type is the from graph's edge
/// type.
- template <typename TargetMap, typename SourceMap>
- GraphCopy& edgeMap(TargetMap& tmap, const SourceMap& map) {
- edgeMapCopies.push_back(new _graph_utils_bits::MapCopy<Source, Edge,
- EdgeRefMap, TargetMap, SourceMap>(tmap, map));
+ template <typename ToMap, typename FromMap>
+ GraphCopy& edgeMap(ToMap& tmap, const FromMap& map) {
+ edgeMapCopies.push_back(new _graph_utils_bits::MapCopy<From, Edge,
+ EdgeRefMap, ToMap, FromMap>(tmap, map));
return *this;
}
@@ -877,7 +886,7 @@
///
/// Make a copy of the given edge.
GraphCopy& edge(TEdge& tedge, const Edge& sedge) {
- edgeMapCopies.push_back(new _graph_utils_bits::ItemCopy<Source, Edge,
+ edgeMapCopies.push_back(new _graph_utils_bits::ItemCopy<From, Edge,
EdgeRefMap, TEdge>(tedge, sedge));
return *this;
}
@@ -886,28 +895,28 @@
///
/// Executes the copies.
void run() {
- NodeRefMap nodeRefMap(source);
- EdgeRefMap edgeRefMap(source);
- _graph_utils_bits::GraphCopySelector<Target>::
- copy(target, source, nodeRefMap, edgeRefMap);
+ NodeRefMap nodeRefMap(from);
+ EdgeRefMap edgeRefMap(from);
+ _graph_utils_bits::GraphCopySelector<To>::
+ copy(to, from, nodeRefMap, edgeRefMap);
for (int i = 0; i < int(nodeMapCopies.size()); ++i) {
- nodeMapCopies[i]->copy(source, nodeRefMap);
+ nodeMapCopies[i]->copy(from, nodeRefMap);
}
for (int i = 0; i < int(edgeMapCopies.size()); ++i) {
- edgeMapCopies[i]->copy(source, edgeRefMap);
+ edgeMapCopies[i]->copy(from, edgeRefMap);
}
}
protected:
- const Source& source;
- Target& target;
+ const From& from;
+ To& to;
- std::vector<_graph_utils_bits::MapCopyBase<Source, Node, NodeRefMap>* >
+ std::vector<_graph_utils_bits::MapCopyBase<From, Node, NodeRefMap>* >
nodeMapCopies;
- std::vector<_graph_utils_bits::MapCopyBase<Source, Edge, EdgeRefMap>* >
+ std::vector<_graph_utils_bits::MapCopyBase<From, Edge, EdgeRefMap>* >
edgeMapCopies;
};
@@ -922,57 +931,57 @@
///\endcode
///
/// After the copy the \c nr map will contain the mapping from the
- /// source graph's nodes to the target graph's nodes and the \c ecr will
- /// contain the mapping from the target graph's edges to the source's
+ /// from graph's nodes to the to graph's nodes and the \c ecr will
+ /// contain the mapping from the to graph's edges to the from's
/// edges.
///
/// \see GraphCopy
- template <typename Target, typename Source>
- GraphCopy<Target, Source> copyGraph(Target& target, const Source& source) {
- return GraphCopy<Target, Source>(target, source);
+ template <typename To, typename From>
+ GraphCopy<To, From> copyGraph(To& to, const From& from) {
+ return GraphCopy<To, From>(to, from);
}
/// \brief Class to copy an undirected graph.
///
/// Class to copy an undirected graph to another graph (duplicate a graph).
/// The simplest way of using it is through the \c copyUGraph() function.
- template <typename Target, typename Source>
+ template <typename To, typename From>
class UGraphCopy {
private:
- typedef typename Source::Node Node;
- typedef typename Source::NodeIt NodeIt;
- typedef typename Source::Edge Edge;
- typedef typename Source::EdgeIt EdgeIt;
- typedef typename Source::UEdge UEdge;
- typedef typename Source::UEdgeIt UEdgeIt;
-
- typedef typename Target::Node TNode;
- typedef typename Target::Edge TEdge;
- typedef typename Target::UEdge TUEdge;
+ typedef typename From::Node Node;
+ typedef typename From::NodeIt NodeIt;
+ typedef typename From::Edge Edge;
+ typedef typename From::EdgeIt EdgeIt;
+ typedef typename From::UEdge UEdge;
+ typedef typename From::UEdgeIt UEdgeIt;
+
+ typedef typename To::Node TNode;
+ typedef typename To::Edge TEdge;
+ typedef typename To::UEdge TUEdge;
- typedef typename Source::template NodeMap<TNode> NodeRefMap;
- typedef typename Source::template UEdgeMap<TUEdge> UEdgeRefMap;
+ typedef typename From::template NodeMap<TNode> NodeRefMap;
+ typedef typename From::template UEdgeMap<TUEdge> UEdgeRefMap;
struct EdgeRefMap {
- EdgeRefMap(const Target& _target, const Source& _source,
+ EdgeRefMap(const To& _to, const From& _from,
const UEdgeRefMap& _uedge_ref, const NodeRefMap& _node_ref)
- : target(_target), source(_source),
+ : to(_to), from(_from),
uedge_ref(_uedge_ref), node_ref(_node_ref) {}
- typedef typename Source::Edge Key;
- typedef typename Target::Edge Value;
+ typedef typename From::Edge Key;
+ typedef typename To::Edge Value;
Value operator[](const Key& key) const {
bool forward =
- (source.direction(key) ==
- (node_ref[source.source(static_cast<const UEdge&>(key))] ==
- target.source(uedge_ref[static_cast<const UEdge&>(key)])));
- return target.direct(uedge_ref[key], forward);
+ (from.direction(key) ==
+ (node_ref[from.source(static_cast<const UEdge&>(key))] ==
+ to.source(uedge_ref[static_cast<const UEdge&>(key)])));
+ return to.direct(uedge_ref[key], forward);
}
- const Target& target;
- const Source& source;
+ const To& to;
+ const From& from;
const UEdgeRefMap& uedge_ref;
const NodeRefMap& node_ref;
};
@@ -983,10 +992,10 @@
/// \brief Constructor for the GraphCopy.
///
- /// It copies the content of the \c _source graph into the
- /// \c _target graph.
- UGraphCopy(Target& _target, const Source& _source)
- : source(_source), target(_target) {}
+ /// It copies the content of the \c _from graph into the
+ /// \c _to graph.
+ UGraphCopy(To& _to, const From& _from)
+ : from(_from), to(_to) {}
/// \brief Destructor of the GraphCopy
///
@@ -1009,7 +1018,7 @@
/// Copies the node references into the given map.
template <typename NodeRef>
UGraphCopy& nodeRef(NodeRef& map) {
- nodeMapCopies.push_back(new _graph_utils_bits::RefCopy<Source, Node,
+ nodeMapCopies.push_back(new _graph_utils_bits::RefCopy<From, Node,
NodeRefMap, NodeRef>(map));
return *this;
}
@@ -1020,7 +1029,7 @@
/// the given map.
template <typename NodeCrossRef>
UGraphCopy& nodeCrossRef(NodeCrossRef& map) {
- nodeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<Source, Node,
+ nodeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<From, Node,
NodeRefMap, NodeCrossRef>(map));
return *this;
}
@@ -1028,13 +1037,13 @@
/// \brief Make copy of the given map.
///
/// Makes copy of the given map for the newly created graph.
- /// The new map's key type is the target graph's node type,
- /// and the copied map's key type is the source graph's node
+ /// The new map's key type is the to graph's node type,
+ /// and the copied map's key type is the from graph's node
/// type.
- template <typename TargetMap, typename SourceMap>
- UGraphCopy& nodeMap(TargetMap& tmap, const SourceMap& map) {
- nodeMapCopies.push_back(new _graph_utils_bits::MapCopy<Source, Node,
- NodeRefMap, TargetMap, SourceMap>(tmap, map));
+ template <typename ToMap, typename FromMap>
+ UGraphCopy& nodeMap(ToMap& tmap, const FromMap& map) {
+ nodeMapCopies.push_back(new _graph_utils_bits::MapCopy<From, Node,
+ NodeRefMap, ToMap, FromMap>(tmap, map));
return *this;
}
@@ -1042,7 +1051,7 @@
///
/// Make a copy of the given node.
UGraphCopy& node(TNode& tnode, const Node& snode) {
- nodeMapCopies.push_back(new _graph_utils_bits::ItemCopy<Source, Node,
+ nodeMapCopies.push_back(new _graph_utils_bits::ItemCopy<From, Node,
NodeRefMap, TNode>(tnode, snode));
return *this;
}
@@ -1052,7 +1061,7 @@
/// Copies the edge references into the given map.
template <typename EdgeRef>
UGraphCopy& edgeRef(EdgeRef& map) {
- edgeMapCopies.push_back(new _graph_utils_bits::RefCopy<Source, Edge,
+ edgeMapCopies.push_back(new _graph_utils_bits::RefCopy<From, Edge,
EdgeRefMap, EdgeRef>(map));
return *this;
}
@@ -1063,7 +1072,7 @@
/// the given map.
template <typename EdgeCrossRef>
UGraphCopy& edgeCrossRef(EdgeCrossRef& map) {
- edgeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<Source, Edge,
+ edgeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<From, Edge,
EdgeRefMap, EdgeCrossRef>(map));
return *this;
}
@@ -1071,13 +1080,13 @@
/// \brief Make copy of the given map.
///
/// Makes copy of the given map for the newly created graph.
- /// The new map's key type is the target graph's edge type,
- /// and the copied map's key type is the source graph's edge
+ /// The new map's key type is the to graph's edge type,
+ /// and the copied map's key type is the from graph's edge
/// type.
- template <typename TargetMap, typename SourceMap>
- UGraphCopy& edgeMap(TargetMap& tmap, const SourceMap& map) {
- edgeMapCopies.push_back(new _graph_utils_bits::MapCopy<Source, Edge,
- EdgeRefMap, TargetMap, SourceMap>(tmap, map));
+ template <typename ToMap, typename FromMap>
+ UGraphCopy& edgeMap(ToMap& tmap, const FromMap& map) {
+ edgeMapCopies.push_back(new _graph_utils_bits::MapCopy<From, Edge,
+ EdgeRefMap, ToMap, FromMap>(tmap, map));
return *this;
}
@@ -1085,7 +1094,7 @@
///
/// Make a copy of the given edge.
UGraphCopy& edge(TEdge& tedge, const Edge& sedge) {
- edgeMapCopies.push_back(new _graph_utils_bits::ItemCopy<Source, Edge,
+ edgeMapCopies.push_back(new _graph_utils_bits::ItemCopy<From, Edge,
EdgeRefMap, TEdge>(tedge, sedge));
return *this;
}
@@ -1095,7 +1104,7 @@
/// Copies the undirected edge references into the given map.
template <typename UEdgeRef>
UGraphCopy& uEdgeRef(UEdgeRef& map) {
- uEdgeMapCopies.push_back(new _graph_utils_bits::RefCopy<Source, UEdge,
+ uEdgeMapCopies.push_back(new _graph_utils_bits::RefCopy<From, UEdge,
UEdgeRefMap, UEdgeRef>(map));
return *this;
}
@@ -1106,7 +1115,7 @@
/// references) into the given map.
template <typename UEdgeCrossRef>
UGraphCopy& uEdgeCrossRef(UEdgeCrossRef& map) {
- uEdgeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<Source,
+ uEdgeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<From,
UEdge, UEdgeRefMap, UEdgeCrossRef>(map));
return *this;
}
@@ -1114,13 +1123,13 @@
/// \brief Make copy of the given map.
///
/// Makes copy of the given map for the newly created graph.
- /// The new map's key type is the target graph's undirected edge type,
- /// and the copied map's key type is the source graph's undirected edge
+ /// The new map's key type is the to graph's undirected edge type,
+ /// and the copied map's key type is the from graph's undirected edge
/// type.
- template <typename TargetMap, typename SourceMap>
- UGraphCopy& uEdgeMap(TargetMap& tmap, const SourceMap& map) {
- uEdgeMapCopies.push_back(new _graph_utils_bits::MapCopy<Source, UEdge,
- UEdgeRefMap, TargetMap, SourceMap>(tmap, map));
+ template <typename ToMap, typename FromMap>
+ UGraphCopy& uEdgeMap(ToMap& tmap, const FromMap& map) {
+ uEdgeMapCopies.push_back(new _graph_utils_bits::MapCopy<From, UEdge,
+ UEdgeRefMap, ToMap, FromMap>(tmap, map));
return *this;
}
@@ -1128,7 +1137,7 @@
///
/// Make a copy of the given undirected edge.
UGraphCopy& uEdge(TUEdge& tuedge, const UEdge& suedge) {
- uEdgeMapCopies.push_back(new _graph_utils_bits::ItemCopy<Source, UEdge,
+ uEdgeMapCopies.push_back(new _graph_utils_bits::ItemCopy<From, UEdge,
UEdgeRefMap, TUEdge>(tuedge, suedge));
return *this;
}
@@ -1137,34 +1146,34 @@
///
/// Executes the copies.
void run() {
- NodeRefMap nodeRefMap(source);
- UEdgeRefMap uEdgeRefMap(source);
- EdgeRefMap edgeRefMap(target, source, uEdgeRefMap, nodeRefMap);
- _graph_utils_bits::UGraphCopySelector<Target>::
- copy(target, source, nodeRefMap, uEdgeRefMap);
+ NodeRefMap nodeRefMap(from);
+ UEdgeRefMap uEdgeRefMap(from);
+ EdgeRefMap edgeRefMap(to, from, uEdgeRefMap, nodeRefMap);
+ _graph_utils_bits::UGraphCopySelector<To>::
+ copy(to, from, nodeRefMap, uEdgeRefMap);
for (int i = 0; i < int(nodeMapCopies.size()); ++i) {
- nodeMapCopies[i]->copy(source, nodeRefMap);
+ nodeMapCopies[i]->copy(from, nodeRefMap);
}
for (int i = 0; i < int(uEdgeMapCopies.size()); ++i) {
- uEdgeMapCopies[i]->copy(source, uEdgeRefMap);
+ uEdgeMapCopies[i]->copy(from, uEdgeRefMap);
}
for (int i = 0; i < int(edgeMapCopies.size()); ++i) {
- edgeMapCopies[i]->copy(source, edgeRefMap);
+ edgeMapCopies[i]->copy(from, edgeRefMap);
}
}
private:
- const Source& source;
- Target& target;
+ const From& from;
+ To& to;
- std::vector<_graph_utils_bits::MapCopyBase<Source, Node, NodeRefMap>* >
+ std::vector<_graph_utils_bits::MapCopyBase<From, Node, NodeRefMap>* >
nodeMapCopies;
- std::vector<_graph_utils_bits::MapCopyBase<Source, Edge, EdgeRefMap>* >
+ std::vector<_graph_utils_bits::MapCopyBase<From, Edge, EdgeRefMap>* >
edgeMapCopies;
- std::vector<_graph_utils_bits::MapCopyBase<Source, UEdge, UEdgeRefMap>* >
+ std::vector<_graph_utils_bits::MapCopyBase<From, UEdge, UEdgeRefMap>* >
uEdgeMapCopies;
};
@@ -1179,15 +1188,15 @@
///\endcode
///
/// After the copy the \c nr map will contain the mapping from the
- /// source graph's nodes to the target graph's nodes and the \c ecr will
- /// contain the mapping from the target graph's edges to the source's
+ /// from graph's nodes to the to graph's nodes and the \c ecr will
+ /// contain the mapping from the to graph's edges to the from's
/// edges.
///
/// \see UGraphCopy
- template <typename Target, typename Source>
- UGraphCopy<Target, Source>
- copyUGraph(Target& target, const Source& source) {
- return UGraphCopy<Target, Source>(target, source);
+ template <typename To, typename From>
+ UGraphCopy<To, From>
+ copyUGraph(To& to, const From& from) {
+ return UGraphCopy<To, From>(to, from);
}
/// \brief Class to copy a bipartite undirected graph.
@@ -1195,63 +1204,63 @@
/// Class to copy a bipartite undirected graph to another graph
/// (duplicate a graph). The simplest way of using it is through
/// the \c copyBpUGraph() function.
- template <typename Target, typename Source>
+ template <typename To, typename From>
class BpUGraphCopy {
private:
- typedef typename Source::Node Node;
- typedef typename Source::ANode ANode;
- typedef typename Source::BNode BNode;
- typedef typename Source::NodeIt NodeIt;
- typedef typename Source::Edge Edge;
- typedef typename Source::EdgeIt EdgeIt;
- typedef typename Source::UEdge UEdge;
- typedef typename Source::UEdgeIt UEdgeIt;
-
- typedef typename Target::Node TNode;
- typedef typename Target::Edge TEdge;
- typedef typename Target::UEdge TUEdge;
-
- typedef typename Source::template ANodeMap<TNode> ANodeRefMap;
- typedef typename Source::template BNodeMap<TNode> BNodeRefMap;
- typedef typename Source::template UEdgeMap<TUEdge> UEdgeRefMap;
+ typedef typename From::Node Node;
+ typedef typename From::ANode ANode;
+ typedef typename From::BNode BNode;
+ typedef typename From::NodeIt NodeIt;
+ typedef typename From::Edge Edge;
+ typedef typename From::EdgeIt EdgeIt;
+ typedef typename From::UEdge UEdge;
+ typedef typename From::UEdgeIt UEdgeIt;
+
+ typedef typename To::Node TNode;
+ typedef typename To::Edge TEdge;
+ typedef typename To::UEdge TUEdge;
+
+ typedef typename From::template ANodeMap<TNode> ANodeRefMap;
+ typedef typename From::template BNodeMap<TNode> BNodeRefMap;
+ typedef typename From::template UEdgeMap<TUEdge> UEdgeRefMap;
struct NodeRefMap {
- NodeRefMap(const Source& _source, const ANodeRefMap& _anode_ref,
+ NodeRefMap(const From& _from, const ANodeRefMap& _anode_ref,
const BNodeRefMap& _bnode_ref)
- : source(_source), anode_ref(_anode_ref), bnode_ref(_bnode_ref) {}
+ : from(_from), anode_ref(_anode_ref), bnode_ref(_bnode_ref) {}
- typedef typename Source::Node Key;
- typedef typename Target::Node Value;
+ typedef typename From::Node Key;
+ typedef typename To::Node Value;
Value operator[](const Key& key) const {
- return source.aNode(key) ? anode_ref[key] : bnode_ref[key];
+ return from.aNode(key) ? anode_ref[key] : bnode_ref[key];
}
- const Source& source;
+ const From& from;
const ANodeRefMap& anode_ref;
const BNodeRefMap& bnode_ref;
};
struct EdgeRefMap {
- EdgeRefMap(const Target& _target, const Source& _source,
+ EdgeRefMap(const To& _to, const From& _from,
const UEdgeRefMap& _uedge_ref, const NodeRefMap& _node_ref)
- : target(_target), source(_source),
+ : to(_to), from(_from),
uedge_ref(_uedge_ref), node_ref(_node_ref) {}
- typedef typename Source::Edge Key;
- typedef typename Target::Edge Value;
+ typedef typename From::Edge Key;
+ typedef typename To::Edge Value;
Value operator[](const Key& key) const {
bool forward =
- (source.direction(key) ==
- (node_ref[source.source(static_cast<const UEdge&>(key))] ==
- target.source(uedge_ref[static_cast<const UEdge&>(key)])));
- return target.direct(uedge_ref[key], forward);
+ (from.direction(key) ==
+ (node_ref[from.source(static_cast<const UEdge&>(key))] ==
+ to.source(uedge_ref[static_cast<const UEdge&>(key)])));
+ return to.direct(uedge_ref[key], forward);
}
- const Target& target;
- const Source& source;
+ const To& to;
+ const From& from;
const UEdgeRefMap& uedge_ref;
const NodeRefMap& node_ref;
};
@@ -1261,10 +1270,10 @@
/// \brief Constructor for the GraphCopy.
///
- /// It copies the content of the \c _source graph into the
- /// \c _target graph.
- BpUGraphCopy(Target& _target, const Source& _source)
- : source(_source), target(_target) {}
+ /// It copies the content of the \c _from graph into the
+ /// \c _to graph.
+ BpUGraphCopy(To& _to, const From& _from)
+ : from(_from), to(_to) {}
/// \brief Destructor of the GraphCopy
///
@@ -1293,7 +1302,7 @@
/// Copies the A-node references into the given map.
template <typename ANodeRef>
BpUGraphCopy& aNodeRef(ANodeRef& map) {
- aNodeMapCopies.push_back(new _graph_utils_bits::RefCopy<Source, ANode,
+ aNodeMapCopies.push_back(new _graph_utils_bits::RefCopy<From, ANode,
ANodeRefMap, ANodeRef>(map));
return *this;
}
@@ -1304,7 +1313,7 @@
/// the given map.
template <typename ANodeCrossRef>
BpUGraphCopy& aNodeCrossRef(ANodeCrossRef& map) {
- aNodeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<Source,
+ aNodeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<From,
ANode, ANodeRefMap, ANodeCrossRef>(map));
return *this;
}
@@ -1312,13 +1321,13 @@
/// \brief Make copy of the given A-node map.
///
/// Makes copy of the given map for the newly created graph.
- /// The new map's key type is the target graph's node type,
- /// and the copied map's key type is the source graph's node
+ /// The new map's key type is the to graph's node type,
+ /// and the copied map's key type is the from graph's node
/// type.
- template <typename TargetMap, typename SourceMap>
- BpUGraphCopy& aNodeMap(TargetMap& tmap, const SourceMap& map) {
- aNodeMapCopies.push_back(new _graph_utils_bits::MapCopy<Source, ANode,
- ANodeRefMap, TargetMap, SourceMap>(tmap, map));
+ template <typename ToMap, typename FromMap>
+ BpUGraphCopy& aNodeMap(ToMap& tmap, const FromMap& map) {
+ aNodeMapCopies.push_back(new _graph_utils_bits::MapCopy<From, ANode,
+ ANodeRefMap, ToMap, FromMap>(tmap, map));
return *this;
}
@@ -1327,7 +1336,7 @@
/// Copies the B-node references into the given map.
template <typename BNodeRef>
BpUGraphCopy& bNodeRef(BNodeRef& map) {
- bNodeMapCopies.push_back(new _graph_utils_bits::RefCopy<Source, BNode,
+ bNodeMapCopies.push_back(new _graph_utils_bits::RefCopy<From, BNode,
BNodeRefMap, BNodeRef>(map));
return *this;
}
@@ -1338,7 +1347,7 @@
/// the given map.
template <typename BNodeCrossRef>
BpUGraphCopy& bNodeCrossRef(BNodeCrossRef& map) {
- bNodeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<Source,
+ bNodeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<From,
BNode, BNodeRefMap, BNodeCrossRef>(map));
return *this;
}
@@ -1346,13 +1355,13 @@
/// \brief Make copy of the given B-node map.
///
/// Makes copy of the given map for the newly created graph.
- /// The new map's key type is the target graph's node type,
- /// and the copied map's key type is the source graph's node
+ /// The new map's key type is the to graph's node type,
+ /// and the copied map's key type is the from graph's node
/// type.
- template <typename TargetMap, typename SourceMap>
- BpUGraphCopy& bNodeMap(TargetMap& tmap, const SourceMap& map) {
- bNodeMapCopies.push_back(new _graph_utils_bits::MapCopy<Source, BNode,
- BNodeRefMap, TargetMap, SourceMap>(tmap, map));
+ template <typename ToMap, typename FromMap>
+ BpUGraphCopy& bNodeMap(ToMap& tmap, const FromMap& map) {
+ bNodeMapCopies.push_back(new _graph_utils_bits::MapCopy<From, BNode,
+ BNodeRefMap, ToMap, FromMap>(tmap, map));
return *this;
}
/// \brief Copies the node references into the given map.
@@ -1360,7 +1369,7 @@
/// Copies the node references into the given map.
template <typename NodeRef>
BpUGraphCopy& nodeRef(NodeRef& map) {
- nodeMapCopies.push_back(new _graph_utils_bits::RefCopy<Source, Node,
+ nodeMapCopies.push_back(new _graph_utils_bits::RefCopy<From, Node,
NodeRefMap, NodeRef>(map));
return *this;
}
@@ -1371,7 +1380,7 @@
/// the given map.
template <typename NodeCrossRef>
BpUGraphCopy& nodeCrossRef(NodeCrossRef& map) {
- nodeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<Source, Node,
+ nodeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<From, Node,
NodeRefMap, NodeCrossRef>(map));
return *this;
}
@@ -1379,13 +1388,13 @@
/// \brief Make copy of the given map.
///
/// Makes copy of the given map for the newly created graph.
- /// The new map's key type is the target graph's node type,
- /// and the copied map's key type is the source graph's node
+ /// The new map's key type is the to graph's node type,
+ /// and the copied map's key type is the from graph's node
/// type.
- template <typename TargetMap, typename SourceMap>
- BpUGraphCopy& nodeMap(TargetMap& tmap, const SourceMap& map) {
- nodeMapCopies.push_back(new _graph_utils_bits::MapCopy<Source, Node,
- NodeRefMap, TargetMap, SourceMap>(tmap, map));
+ template <typename ToMap, typename FromMap>
+ BpUGraphCopy& nodeMap(ToMap& tmap, const FromMap& map) {
+ nodeMapCopies.push_back(new _graph_utils_bits::MapCopy<From, Node,
+ NodeRefMap, ToMap, FromMap>(tmap, map));
return *this;
}
@@ -1393,7 +1402,7 @@
///
/// Make a copy of the given node.
BpUGraphCopy& node(TNode& tnode, const Node& snode) {
- nodeMapCopies.push_back(new _graph_utils_bits::ItemCopy<Source, Node,
+ nodeMapCopies.push_back(new _graph_utils_bits::ItemCopy<From, Node,
NodeRefMap, TNode>(tnode, snode));
return *this;
}
@@ -1403,7 +1412,7 @@
/// Copies the edge references into the given map.
template <typename EdgeRef>
BpUGraphCopy& edgeRef(EdgeRef& map) {
- edgeMapCopies.push_back(new _graph_utils_bits::RefCopy<Source, Edge,
+ edgeMapCopies.push_back(new _graph_utils_bits::RefCopy<From, Edge,
EdgeRefMap, EdgeRef>(map));
return *this;
}
@@ -1414,7 +1423,7 @@
/// the given map.
template <typename EdgeCrossRef>
BpUGraphCopy& edgeCrossRef(EdgeCrossRef& map) {
- edgeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<Source, Edge,
+ edgeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<From, Edge,
EdgeRefMap, EdgeCrossRef>(map));
return *this;
}
@@ -1422,13 +1431,13 @@
/// \brief Make copy of the given map.
///
/// Makes copy of the given map for the newly created graph.
- /// The new map's key type is the target graph's edge type,
- /// and the copied map's key type is the source graph's edge
+ /// The new map's key type is the to graph's edge type,
+ /// and the copied map's key type is the from graph's edge
/// type.
- template <typename TargetMap, typename SourceMap>
- BpUGraphCopy& edgeMap(TargetMap& tmap, const SourceMap& map) {
- edgeMapCopies.push_back(new _graph_utils_bits::MapCopy<Source, Edge,
- EdgeRefMap, TargetMap, SourceMap>(tmap, map));
+ template <typename ToMap, typename FromMap>
+ BpUGraphCopy& edgeMap(ToMap& tmap, const FromMap& map) {
+ edgeMapCopies.push_back(new _graph_utils_bits::MapCopy<From, Edge,
+ EdgeRefMap, ToMap, FromMap>(tmap, map));
return *this;
}
@@ -1436,7 +1445,7 @@
///
/// Make a copy of the given edge.
BpUGraphCopy& edge(TEdge& tedge, const Edge& sedge) {
- edgeMapCopies.push_back(new _graph_utils_bits::ItemCopy<Source, Edge,
+ edgeMapCopies.push_back(new _graph_utils_bits::ItemCopy<From, Edge,
EdgeRefMap, TEdge>(tedge, sedge));
return *this;
}
@@ -1446,7 +1455,7 @@
/// Copies the undirected edge references into the given map.
template <typename UEdgeRef>
BpUGraphCopy& uEdgeRef(UEdgeRef& map) {
- uEdgeMapCopies.push_back(new _graph_utils_bits::RefCopy<Source, UEdge,
+ uEdgeMapCopies.push_back(new _graph_utils_bits::RefCopy<From, UEdge,
UEdgeRefMap, UEdgeRef>(map));
return *this;
}
@@ -1457,7 +1466,7 @@
/// references) into the given map.
template <typename UEdgeCrossRef>
BpUGraphCopy& uEdgeCrossRef(UEdgeCrossRef& map) {
- uEdgeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<Source,
+ uEdgeMapCopies.push_back(new _graph_utils_bits::CrossRefCopy<From,
UEdge, UEdgeRefMap, UEdgeCrossRef>(map));
return *this;
}
@@ -1465,13 +1474,13 @@
/// \brief Make copy of the given map.
///
/// Makes copy of the given map for the newly created graph.
- /// The new map's key type is the target graph's undirected edge type,
- /// and the copied map's key type is the source graph's undirected edge
+ /// The new map's key type is the to graph's undirected edge type,
+ /// and the copied map's key type is the from graph's undirected edge
/// type.
- template <typename TargetMap, typename SourceMap>
- BpUGraphCopy& uEdgeMap(TargetMap& tmap, const SourceMap& map) {
- uEdgeMapCopies.push_back(new _graph_utils_bits::MapCopy<Source, UEdge,
- UEdgeRefMap, TargetMap, SourceMap>(tmap, map));
+ template <typename ToMap, typename FromMap>
+ BpUGraphCopy& uEdgeMap(ToMap& tmap, const FromMap& map) {
+ uEdgeMapCopies.push_back(new _graph_utils_bits::MapCopy<From, UEdge,
+ UEdgeRefMap, ToMap, FromMap>(tmap, map));
return *this;
}
@@ -1479,7 +1488,7 @@
///
/// Make a copy of the given undirected edge.
BpUGraphCopy& uEdge(TUEdge& tuedge, const UEdge& suedge) {
- uEdgeMapCopies.push_back(new _graph_utils_bits::ItemCopy<Source, UEdge,
+ uEdgeMapCopies.push_back(new _graph_utils_bits::ItemCopy<From, UEdge,
UEdgeRefMap, TUEdge>(tuedge, suedge));
return *this;
}
@@ -1488,48 +1497,48 @@
///
/// Executes the copies.
void run() {
- ANodeRefMap aNodeRefMap(source);
- BNodeRefMap bNodeRefMap(source);
- NodeRefMap nodeRefMap(source, aNodeRefMap, bNodeRefMap);
- UEdgeRefMap uEdgeRefMap(source);
- EdgeRefMap edgeRefMap(target, source, uEdgeRefMap, nodeRefMap);
- _graph_utils_bits::BpUGraphCopySelector<Target>::
- copy(target, source, aNodeRefMap, bNodeRefMap, uEdgeRefMap);
+ ANodeRefMap aNodeRefMap(from);
+ BNodeRefMap bNodeRefMap(from);
+ NodeRefMap nodeRefMap(from, aNodeRefMap, bNodeRefMap);
+ UEdgeRefMap uEdgeRefMap(from);
+ EdgeRefMap edgeRefMap(to, from, uEdgeRefMap, nodeRefMap);
+ _graph_utils_bits::BpUGraphCopySelector<To>::
+ copy(to, from, aNodeRefMap, bNodeRefMap, uEdgeRefMap);
for (int i = 0; i < int(aNodeMapCopies.size()); ++i) {
- aNodeMapCopies[i]->copy(source, aNodeRefMap);
+ aNodeMapCopies[i]->copy(from, aNodeRefMap);
}
for (int i = 0; i < int(bNodeMapCopies.size()); ++i) {
- bNodeMapCopies[i]->copy(source, bNodeRefMap);
+ bNodeMapCopies[i]->copy(from, bNodeRefMap);
}
for (int i = 0; i < int(nodeMapCopies.size()); ++i) {
- nodeMapCopies[i]->copy(source, nodeRefMap);
+ nodeMapCopies[i]->copy(from, nodeRefMap);
}
for (int i = 0; i < int(uEdgeMapCopies.size()); ++i) {
- uEdgeMapCopies[i]->copy(source, uEdgeRefMap);
+ uEdgeMapCopies[i]->copy(from, uEdgeRefMap);
}
for (int i = 0; i < int(edgeMapCopies.size()); ++i) {
- edgeMapCopies[i]->copy(source, edgeRefMap);
+ edgeMapCopies[i]->copy(from, edgeRefMap);
}
}
private:
- const Source& source;
- Target& target;
+ const From& from;
+ To& to;
- std::vector<_graph_utils_bits::MapCopyBase<Source, ANode, ANodeRefMap>* >
+ std::vector<_graph_utils_bits::MapCopyBase<From, ANode, ANodeRefMap>* >
aNodeMapCopies;
- std::vector<_graph_utils_bits::MapCopyBase<Source, BNode, BNodeRefMap>* >
+ std::vector<_graph_utils_bits::MapCopyBase<From, BNode, BNodeRefMap>* >
bNodeMapCopies;
- std::vector<_graph_utils_bits::MapCopyBase<Source, Node, NodeRefMap>* >
+ std::vector<_graph_utils_bits::MapCopyBase<From, Node, NodeRefMap>* >
nodeMapCopies;
- std::vector<_graph_utils_bits::MapCopyBase<Source, Edge, EdgeRefMap>* >
+ std::vector<_graph_utils_bits::MapCopyBase<From, Edge, EdgeRefMap>* >
edgeMapCopies;
- std::vector<_graph_utils_bits::MapCopyBase<Source, UEdge, UEdgeRefMap>* >
+ std::vector<_graph_utils_bits::MapCopyBase<From, UEdge, UEdgeRefMap>* >
uEdgeMapCopies;
};
@@ -1544,15 +1553,15 @@
///\endcode
///
/// After the copy the \c nr map will contain the mapping from the
- /// source graph's nodes to the target graph's nodes and the \c ecr will
- /// contain the mapping from the target graph's edges to the source's
+ /// from graph's nodes to the to graph's nodes and the \c ecr will
+ /// contain the mapping from the to graph's edges to the from's
/// edges.
///
/// \see BpUGraphCopy
- template <typename Target, typename Source>
- BpUGraphCopy<Target, Source>
- copyBpUGraph(Target& target, const Source& source) {
- return BpUGraphCopy<Target, Source>(target, source);
+ template <typename To, typename From>
+ BpUGraphCopy<To, From>
+ copyBpUGraph(To& to, const From& from) {
+ return BpUGraphCopy<To, From>(to, from);
}
More information about the Lemon-commits
mailing list