# HG changeset patch # User Balazs Dezso # Date 1326316867 -3600 # Node ID 699c7eac2c6dea417e75c9d4432f5944938f97d8 # Parent c8fa41fcc4a70873b604e769c68110949cb6e75b Renamings in BpGraphs (#69) - RedIt->RedNodeIt - BlueIt->BlueNodeIt - RedMap->RedNodeMap - BlueMap->BlueNodeMap diff -r c8fa41fcc4a7 -r 699c7eac2c6d lemon/bits/graph_extender.h --- a/lemon/bits/graph_extender.h Thu Dec 01 09:05:47 2011 +0100 +++ b/lemon/bits/graph_extender.h Wed Jan 11 22:21:07 2012 +0100 @@ -913,44 +913,44 @@ }; - class RedIt : public RedNode { + class RedNodeIt : public RedNode { const BpGraph* _graph; public: - RedIt() {} + RedNodeIt() {} - RedIt(Invalid i) : RedNode(i) { } + RedNodeIt(Invalid i) : RedNode(i) { } - explicit RedIt(const BpGraph& graph) : _graph(&graph) { + explicit RedNodeIt(const BpGraph& graph) : _graph(&graph) { _graph->first(static_cast(*this)); } - RedIt(const BpGraph& graph, const RedNode& node) + RedNodeIt(const BpGraph& graph, const RedNode& node) : RedNode(node), _graph(&graph) {} - RedIt& operator++() { + RedNodeIt& operator++() { _graph->next(static_cast(*this)); return *this; } }; - class BlueIt : public BlueNode { + class BlueNodeIt : public BlueNode { const BpGraph* _graph; public: - BlueIt() {} + BlueNodeIt() {} - BlueIt(Invalid i) : BlueNode(i) { } + BlueNodeIt(Invalid i) : BlueNode(i) { } - explicit BlueIt(const BpGraph& graph) : _graph(&graph) { + explicit BlueNodeIt(const BpGraph& graph) : _graph(&graph) { _graph->first(static_cast(*this)); } - BlueIt(const BpGraph& graph, const BlueNode& node) + BlueNodeIt(const BpGraph& graph, const BlueNode& node) : BlueNode(node), _graph(&graph) {} - BlueIt& operator++() { + BlueNodeIt& operator++() { _graph->next(static_cast(*this)); return *this; } @@ -1144,23 +1144,23 @@ }; template - class RedMap + class RedNodeMap : public MapExtender > { typedef MapExtender > Parent; public: - explicit RedMap(const BpGraph& bpgraph) + explicit RedNodeMap(const BpGraph& bpgraph) : Parent(bpgraph) {} - RedMap(const BpGraph& bpgraph, const _Value& value) + RedNodeMap(const BpGraph& bpgraph, const _Value& value) : Parent(bpgraph, value) {} private: - RedMap& operator=(const RedMap& cmap) { - return operator=(cmap); + RedNodeMap& operator=(const RedNodeMap& cmap) { + return operator=(cmap); } template - RedMap& operator=(const CMap& cmap) { + RedNodeMap& operator=(const CMap& cmap) { Parent::operator=(cmap); return *this; } @@ -1168,23 +1168,23 @@ }; template - class BlueMap + class BlueNodeMap : public MapExtender > { typedef MapExtender > Parent; public: - explicit BlueMap(const BpGraph& bpgraph) + explicit BlueNodeMap(const BpGraph& bpgraph) : Parent(bpgraph) {} - BlueMap(const BpGraph& bpgraph, const _Value& value) + BlueNodeMap(const BpGraph& bpgraph, const _Value& value) : Parent(bpgraph, value) {} private: - BlueMap& operator=(const BlueMap& cmap) { - return operator=(cmap); + BlueNodeMap& operator=(const BlueNodeMap& cmap) { + return operator=(cmap); } template - BlueMap& operator=(const CMap& cmap) { + BlueNodeMap& operator=(const CMap& cmap) { Parent::operator=(cmap); return *this; } diff -r c8fa41fcc4a7 -r 699c7eac2c6d lemon/bits/traits.h --- a/lemon/bits/traits.h Thu Dec 01 09:05:47 2011 +0100 +++ b/lemon/bits/traits.h Wed Jan 11 22:21:07 2012 +0100 @@ -172,16 +172,16 @@ typedef GR Digraph; typedef typename GR::RedNode Item; - typedef typename GR::RedIt ItemIt; + typedef typename GR::RedNodeIt ItemIt; typedef typename RedNodeNotifierIndicator::Type ItemNotifier; template - class Map : public GR::template RedMap { - typedef typename GR::template RedMap Parent; + class Map : public GR::template RedNodeMap { + typedef typename GR::template RedNodeMap Parent; public: - typedef typename GR::template RedMap Type; + typedef typename GR::template RedNodeMap Type; typedef typename Parent::Value Value; Map(const GR& _bpgraph) : Parent(_bpgraph) {} @@ -213,16 +213,16 @@ typedef GR Digraph; typedef typename GR::BlueNode Item; - typedef typename GR::BlueIt ItemIt; + typedef typename GR::BlueNodeIt ItemIt; typedef typename BlueNodeNotifierIndicator::Type ItemNotifier; template - class Map : public GR::template BlueMap { - typedef typename GR::template BlueMap Parent; + class Map : public GR::template BlueNodeMap { + typedef typename GR::template BlueNodeMap Parent; public: - typedef typename GR::template BlueMap Type; + typedef typename GR::template BlueNodeMap Type; typedef typename Parent::Value Value; Map(const GR& _bpgraph) : Parent(_bpgraph) {} diff -r c8fa41fcc4a7 -r 699c7eac2c6d lemon/concepts/bpgraph.h --- a/lemon/concepts/bpgraph.h Thu Dec 01 09:05:47 2011 +0100 +++ b/lemon/concepts/bpgraph.h Wed Jan 11 22:21:07 2012 +0100 @@ -48,9 +48,9 @@ /// The bipartite graphs also fulfill the concept of \ref Graph /// "undirected graphs". Bipartite graphs provide a bipartition of /// the node set, namely a red and blue set of the nodes. The - /// nodes can be iterated with the RedIt and BlueIt in the two - /// node sets. With RedMap and BlueMap values can be assigned to - /// the nodes in the two sets. + /// nodes can be iterated with the RedNodeIt and BlueNodeIt in the + /// two node sets. With RedNodeMap and BlueNodeMap values can be + /// assigned to the nodes in the two sets. /// /// The edges of the graph cannot connect two nodes of the same /// set. The edges inherent orientation is from the red nodes to @@ -187,38 +187,38 @@ /// int count=0; /// for (BpGraph::RedNodeIt n(g); n!=INVALID; ++n) ++count; ///\endcode - class RedIt : public RedNode { + class RedNodeIt : public RedNode { public: /// Default constructor /// Default constructor. /// \warning It sets the iterator to an undefined value. - RedIt() { } + RedNodeIt() { } /// Copy constructor. /// Copy constructor. /// - RedIt(const RedIt& n) : RedNode(n) { } + RedNodeIt(const RedNodeIt& n) : RedNode(n) { } /// %Invalid constructor \& conversion. /// Initializes the iterator to be invalid. /// \sa Invalid for more details. - RedIt(Invalid) { } + RedNodeIt(Invalid) { } /// Sets the iterator to the first red node. /// Sets the iterator to the first red node of the given /// digraph. - explicit RedIt(const BpGraph&) { } + explicit RedNodeIt(const BpGraph&) { } /// Sets the iterator to the given red node. /// Sets the iterator to the given red node of the given /// digraph. - RedIt(const BpGraph&, const RedNode&) { } + RedNodeIt(const BpGraph&, const RedNode&) { } /// Next node. /// Assign the iterator to the next red node. /// - RedIt& operator++() { return *this; } + RedNodeIt& operator++() { return *this; } }; /// Iterator class for the blue nodes. @@ -230,38 +230,38 @@ /// int count=0; /// for (BpGraph::BlueNodeIt n(g); n!=INVALID; ++n) ++count; ///\endcode - class BlueIt : public BlueNode { + class BlueNodeIt : public BlueNode { public: /// Default constructor /// Default constructor. /// \warning It sets the iterator to an undefined value. - BlueIt() { } + BlueNodeIt() { } /// Copy constructor. /// Copy constructor. /// - BlueIt(const BlueIt& n) : BlueNode(n) { } + BlueNodeIt(const BlueNodeIt& n) : BlueNode(n) { } /// %Invalid constructor \& conversion. /// Initializes the iterator to be invalid. /// \sa Invalid for more details. - BlueIt(Invalid) { } + BlueNodeIt(Invalid) { } /// Sets the iterator to the first blue node. /// Sets the iterator to the first blue node of the given /// digraph. - explicit BlueIt(const BpGraph&) { } + explicit BlueNodeIt(const BpGraph&) { } /// Sets the iterator to the given blue node. /// Sets the iterator to the given blue node of the given /// digraph. - BlueIt(const BpGraph&, const BlueNode&) { } + BlueNodeIt(const BpGraph&, const BlueNode&) { } /// Next node. /// Assign the iterator to the next blue node. /// - BlueIt& operator++() { return *this; } + BlueNodeIt& operator++() { return *this; } }; /// Iterator class for the nodes. @@ -663,22 +663,22 @@ /// Standard graph map type for the red nodes. /// It conforms to the ReferenceMap concept. template - class RedMap : public ReferenceMap + class RedNodeMap : public ReferenceMap { public: /// Constructor - explicit RedMap(const BpGraph&) { } + explicit RedNodeMap(const BpGraph&) { } /// Constructor with given initial value - RedMap(const BpGraph&, T) { } + RedNodeMap(const BpGraph&, T) { } private: ///Copy constructor - RedMap(const RedMap& nm) : + RedNodeMap(const RedNodeMap& nm) : ReferenceMap(nm) { } ///Assignment operator template - RedMap& operator=(const CMap&) { + RedNodeMap& operator=(const CMap&) { checkConcept, CMap>(); return *this; } @@ -689,22 +689,22 @@ /// Standard graph map type for the blue nodes. /// It conforms to the ReferenceMap concept. template - class BlueMap : public ReferenceMap + class BlueNodeMap : public ReferenceMap { public: /// Constructor - explicit BlueMap(const BpGraph&) { } + explicit BlueNodeMap(const BpGraph&) { } /// Constructor with given initial value - BlueMap(const BpGraph&, T) { } + BlueNodeMap(const BpGraph&, T) { } private: ///Copy constructor - BlueMap(const BlueMap& nm) : + BlueNodeMap(const BlueNodeMap& nm) : ReferenceMap(nm) { } ///Assignment operator template - BlueMap& operator=(const CMap&) { + BlueNodeMap& operator=(const CMap&) { checkConcept, CMap>(); return *this; } diff -r c8fa41fcc4a7 -r 699c7eac2c6d lemon/concepts/graph_components.h --- a/lemon/concepts/graph_components.h Thu Dec 01 09:05:47 2011 +0100 +++ b/lemon/concepts/graph_components.h Wed Jan 11 22:21:07 2012 +0100 @@ -1206,12 +1206,12 @@ /// \brief This iterator goes through each red node. /// /// This iterator goes through each red node. - typedef GraphItemIt RedIt; + typedef GraphItemIt RedNodeIt; /// \brief This iterator goes through each blue node. /// /// This iterator goes through each blue node. - typedef GraphItemIt BlueIt; + typedef GraphItemIt BlueNodeIt; /// @} @@ -1228,9 +1228,9 @@ bpgraph.next(bn); checkConcept, - typename _BpGraph::RedIt>(); + typename _BpGraph::RedNodeIt>(); checkConcept, - typename _BpGraph::BlueIt>(); + typename _BpGraph::BlueNodeIt>(); } const _BpGraph& bpgraph; @@ -1715,7 +1715,8 @@ /// This class describes the interface of mappable undirected /// bipartite graphs. It extends \ref MappableGraphComponent with /// the standard graph map class for red and blue nodes (\c - /// RedMap and BlueMap). This concept is part of the BpGraph concept. + /// RedNodeMap and BlueNodeMap). This concept is part of the + /// BpGraph concept. template class MappableBpGraphComponent : public MappableGraphComponent { public: @@ -1730,33 +1731,33 @@ /// Standard graph map for the red nodes. /// It conforms to the ReferenceMap concept. template - class RedMap : public GraphMap { + class RedNodeMap : public GraphMap { typedef GraphMap Parent; public: /// \brief Construct a new map. /// /// Construct a new map for the graph. - explicit RedMap(const MappableBpGraphComponent& graph) + explicit RedNodeMap(const MappableBpGraphComponent& graph) : Parent(graph) {} /// \brief Construct a new map with default value. /// /// Construct a new map for the graph and initalize the values. - RedMap(const MappableBpGraphComponent& graph, const V& value) + RedNodeMap(const MappableBpGraphComponent& graph, const V& value) : Parent(graph, value) {} private: /// \brief Copy constructor. /// /// Copy Constructor. - RedMap(const RedMap& nm) : Parent(nm) {} + RedNodeMap(const RedNodeMap& nm) : Parent(nm) {} /// \brief Assignment operator. /// /// Assignment operator. template - RedMap& operator=(const CMap&) { + RedNodeMap& operator=(const CMap&) { checkConcept, CMap>(); return *this; } @@ -1768,33 +1769,33 @@ /// Standard graph map for the blue nodes. /// It conforms to the ReferenceMap concept. template - class BlueMap : public GraphMap { + class BlueNodeMap : public GraphMap { typedef GraphMap Parent; public: /// \brief Construct a new map. /// /// Construct a new map for the graph. - explicit BlueMap(const MappableBpGraphComponent& graph) + explicit BlueNodeMap(const MappableBpGraphComponent& graph) : Parent(graph) {} /// \brief Construct a new map with default value. /// /// Construct a new map for the graph and initalize the values. - BlueMap(const MappableBpGraphComponent& graph, const V& value) + BlueNodeMap(const MappableBpGraphComponent& graph, const V& value) : Parent(graph, value) {} private: /// \brief Copy constructor. /// /// Copy Constructor. - BlueMap(const BlueMap& nm) : Parent(nm) {} + BlueNodeMap(const BlueNodeMap& nm) : Parent(nm) {} /// \brief Assignment operator. /// /// Assignment operator. template - BlueMap& operator=(const CMap&) { + BlueNodeMap& operator=(const CMap&) { checkConcept, CMap>(); return *this; } @@ -1815,31 +1816,37 @@ checkConcept, _BpGraph>(); { // int map test - typedef typename _BpGraph::template RedMap IntRedMap; + typedef typename _BpGraph::template RedNodeMap + IntRedNodeMap; checkConcept, - IntRedMap >(); + IntRedNodeMap >(); } { // bool map test - typedef typename _BpGraph::template RedMap BoolRedMap; + typedef typename _BpGraph::template RedNodeMap + BoolRedNodeMap; checkConcept, - BoolRedMap >(); + BoolRedNodeMap >(); } { // Dummy map test - typedef typename _BpGraph::template RedMap DummyRedMap; + typedef typename _BpGraph::template RedNodeMap + DummyRedNodeMap; checkConcept, - DummyRedMap >(); + DummyRedNodeMap >(); } { // int map test - typedef typename _BpGraph::template BlueMap IntBlueMap; + typedef typename _BpGraph::template BlueNodeMap + IntBlueNodeMap; checkConcept, - IntBlueMap >(); + IntBlueNodeMap >(); } { // bool map test - typedef typename _BpGraph::template BlueMap BoolBlueMap; + typedef typename _BpGraph::template BlueNodeMap + BoolBlueNodeMap; checkConcept, - BoolBlueMap >(); + BoolBlueNodeMap >(); } { // Dummy map test - typedef typename _BpGraph::template BlueMap DummyBlueMap; + typedef typename _BpGraph::template BlueNodeMap + DummyBlueNodeMap; checkConcept, - DummyBlueMap >(); + DummyBlueNodeMap >(); } } diff -r c8fa41fcc4a7 -r 699c7eac2c6d lemon/core.h --- a/lemon/core.h Thu Dec 01 09:05:47 2011 +0100 +++ b/lemon/core.h Wed Jan 11 22:21:07 2012 +0100 @@ -150,10 +150,11 @@ ///Create convenience typedefs for the bipartite graph types and iterators - ///This \c \#define creates the same convenient type definitions as defined - ///by \ref GRAPH_TYPEDEFS(BpGraph) and ten more, namely it creates - ///\c RedNode, \c RedIt, \c BoolRedMap, \c IntRedMap, \c DoubleRedMap, - ///\c BlueNode, \c BlueIt, \c BoolBlueMap, \c IntBlueMap, \c DoubleBlueMap. + ///This \c \#define creates the same convenient type definitions as + ///defined by \ref GRAPH_TYPEDEFS(BpGraph) and ten more, namely it + ///creates \c RedNode, \c RedNodeIt, \c BoolRedNodeMap, + ///\c IntRedNodeMap, \c DoubleRedNodeMap, \c BlueNode, \c BlueNodeIt, + ///\c BoolBlueNodeMap, \c IntBlueNodeMap, \c DoubleBlueNodeMap. /// ///\note If the graph type is a dependent type, ie. the graph type depend ///on a template parameter, then use \c TEMPLATE_BPGRAPH_TYPEDEFS() @@ -161,15 +162,15 @@ #define BPGRAPH_TYPEDEFS(BpGraph) \ GRAPH_TYPEDEFS(BpGraph); \ typedef BpGraph::RedNode RedNode; \ - typedef BpGraph::RedIt RedIt; \ - typedef BpGraph::RedMap BoolRedMap; \ - typedef BpGraph::RedMap IntRedMap; \ - typedef BpGraph::RedMap DoubleRedMap; \ + typedef BpGraph::RedNodeIt RedNodeIt; \ + typedef BpGraph::RedNodeMap BoolRedNodeMap; \ + typedef BpGraph::RedNodeMap IntRedNodeMap; \ + typedef BpGraph::RedNodeMap DoubleRedNodeMap; \ typedef BpGraph::BlueNode BlueNode; \ - typedef BpGraph::BlueIt BlueIt; \ - typedef BpGraph::BlueMap BoolBlueMap; \ - typedef BpGraph::BlueMap IntBlueMap; \ - typedef BpGraph::BlueMap DoubleBlueMap + typedef BpGraph::BlueNodeIt BlueNodeIt; \ + typedef BpGraph::BlueNodeMap BoolBlueNodeMap; \ + typedef BpGraph::BlueNodeMap IntBlueNodeMap; \ + typedef BpGraph::BlueNodeMap DoubleBlueNodeMap ///Create convenience typedefs for the bipartite graph types and iterators @@ -177,18 +178,18 @@ /// ///\note Use this macro, if the graph type is a dependent type, ///ie. the graph type depend on a template parameter. -#define TEMPLATE_BPGRAPH_TYPEDEFS(BpGraph) \ - TEMPLATE_GRAPH_TYPEDEFS(BpGraph); \ - typedef typename BpGraph::RedNode RedNode; \ - typedef typename BpGraph::RedIt RedIt; \ - typedef typename BpGraph::template RedMap BoolRedMap; \ - typedef typename BpGraph::template RedMap IntRedMap; \ - typedef typename BpGraph::template RedMap DoubleRedMap; \ - typedef typename BpGraph::BlueNode BlueNode; \ - typedef typename BpGraph::BlueIt BlueIt; \ - typedef typename BpGraph::template BlueMap BoolBlueMap; \ - typedef typename BpGraph::template BlueMap IntBlueMap; \ - typedef typename BpGraph::template BlueMap DoubleBlueMap +#define TEMPLATE_BPGRAPH_TYPEDEFS(BpGraph) \ + TEMPLATE_GRAPH_TYPEDEFS(BpGraph); \ + typedef typename BpGraph::RedNode RedNode; \ + typedef typename BpGraph::RedNodeIt RedNodeIt; \ + typedef typename BpGraph::template RedNodeMap BoolRedNodeMap; \ + typedef typename BpGraph::template RedNodeMap IntRedNodeMap; \ + typedef typename BpGraph::template RedNodeMap DoubleRedNodeMap; \ + typedef typename BpGraph::BlueNode BlueNode; \ + typedef typename BpGraph::BlueNodeIt BlueNodeIt; \ + typedef typename BpGraph::template BlueNodeMap BoolBlueNodeMap; \ + typedef typename BpGraph::template BlueNodeMap IntBlueNodeMap; \ + typedef typename BpGraph::template BlueNodeMap DoubleBlueNodeMap /// \brief Function to count the items in a graph. /// @@ -565,10 +566,10 @@ BlueNodeRefMap& blueNodeRefMap, EdgeRefMap& edgeRefMap) { to.clear(); - for (typename From::RedIt it(from); it != INVALID; ++it) { + for (typename From::RedNodeIt it(from); it != INVALID; ++it) { redNodeRefMap[it] = to.addRedNode(); } - for (typename From::BlueIt it(from); it != INVALID; ++it) { + for (typename From::BlueNodeIt it(from); it != INVALID; ++it) { blueNodeRefMap[it] = to.addBlueNode(); } for (typename From::EdgeIt it(from); it != INVALID; ++it) { @@ -1164,10 +1165,10 @@ /// // Create cross references (inverse) for the edges /// NewBpGraph::EdgeMap ecr(new_graph); /// cg.edgeCrossRef(ecr); - /// // Copy a red map - /// OrigBpGraph::RedMap ormap(orig_graph); - /// NewBpGraph::RedMap nrmap(new_graph); - /// cg.edgeMap(ormap, nrmap); + /// // Copy a red node map + /// OrigBpGraph::RedNodeMap ormap(orig_graph); + /// NewBpGraph::RedNodeMap nrmap(new_graph); + /// cg.redNodeMap(ormap, nrmap); /// // Copy a node /// OrigBpGraph::Node on; /// NewBpGraph::Node nn; @@ -1194,8 +1195,8 @@ typedef typename To::Arc TArc; typedef typename To::Edge TEdge; - typedef typename From::template RedMap RedNodeRefMap; - typedef typename From::template BlueMap BlueNodeRefMap; + typedef typename From::template RedNodeMap RedNodeRefMap; + typedef typename From::template BlueNodeMap BlueNodeRefMap; typedef typename From::template EdgeMap EdgeRefMap; struct NodeRefMap { @@ -1352,7 +1353,7 @@ /// the original map \c map should be the Node type of the source /// graph. template - BpGraphCopy& redMap(const FromMap& map, ToMap& tmap) { + BpGraphCopy& redNodeMap(const FromMap& map, ToMap& tmap) { _red_maps.push_back(new _core_bits::MapCopy(map, tmap)); return *this; @@ -1403,7 +1404,7 @@ /// the original map \c map should be the Node type of the source /// graph. template - BpGraphCopy& blueMap(const FromMap& map, ToMap& tmap) { + BpGraphCopy& blueNodeMap(const FromMap& map, ToMap& tmap) { _blue_maps.push_back(new _core_bits::MapCopy(map, tmap)); return *this; diff -r c8fa41fcc4a7 -r 699c7eac2c6d lemon/lgf_reader.h --- a/lemon/lgf_reader.h Thu Dec 01 09:05:47 2011 +0100 +++ b/lemon/lgf_reader.h Wed Jan 11 22:21:07 2012 +0100 @@ -2148,7 +2148,7 @@ /// reads the red and blue nodes from separate sections, and these /// sections can contain different set of maps. /// - /// The red and blue maps are read from the corresponding + /// The red and blue node maps are read from the corresponding /// sections. If a map is defined with the same name in both of /// these sections, then it can be read as a node map. template @@ -2337,9 +2337,9 @@ return *this; } - /// Add a red map reading rule to the reader. + /// Add a red node map reading rule to the reader. template - BpGraphReader& redMap(const std::string& caption, Map& map) { + BpGraphReader& redNodeMap(const std::string& caption, Map& map) { checkConcept, Map>(); _reader_bits::MapStorageBase* storage = new _reader_bits::MapStorage(map); @@ -2347,13 +2347,13 @@ return *this; } - /// \brief Red map reading rule + /// \brief Red node map reading rule /// - /// Add a red map reading rule with specialized converter to the - /// reader. + /// Add a red node map node reading rule with specialized converter to + /// the reader. template - BpGraphReader& redMap(const std::string& caption, Map& map, - const Converter& converter = Converter()) { + BpGraphReader& redNodeMap(const std::string& caption, Map& map, + const Converter& converter = Converter()) { checkConcept, Map>(); _reader_bits::MapStorageBase* storage = new _reader_bits::MapStorage(map, converter); @@ -2361,9 +2361,9 @@ return *this; } - /// Add a blue map reading rule to the reader. + /// Add a blue node map reading rule to the reader. template - BpGraphReader& blueMap(const std::string& caption, Map& map) { + BpGraphReader& blueNodeMap(const std::string& caption, Map& map) { checkConcept, Map>(); _reader_bits::MapStorageBase* storage = new _reader_bits::MapStorage(map); @@ -2371,13 +2371,13 @@ return *this; } - /// \brief Blue map reading rule + /// \brief Blue node map reading rule /// - /// Add a blue map reading rule with specialized converter to the - /// reader. + /// Add a blue node map reading rule with specialized converter to + /// the reader. template - BpGraphReader& blueMap(const std::string& caption, Map& map, - const Converter& converter = Converter()) { + BpGraphReader& blueNodeMap(const std::string& caption, Map& map, + const Converter& converter = Converter()) { checkConcept, Map>(); _reader_bits::MapStorageBase* storage = new _reader_bits::MapStorage(map, converter); @@ -2684,7 +2684,7 @@ while (_reader_bits::readToken(line, map)) { if (maps.find(map) != maps.end()) { std::ostringstream msg; - msg << "Multiple occurence of red map: " << map; + msg << "Multiple occurence of red node map: " << map; throw FormatError(msg.str()); } maps.insert(std::make_pair(map, index)); @@ -2777,7 +2777,7 @@ while (_reader_bits::readToken(line, map)) { if (maps.find(map) != maps.end()) { std::ostringstream msg; - msg << "Multiple occurence of blue map: " << map; + msg << "Multiple occurence of blue node map: " << map; throw FormatError(msg.str()); } maps.insert(std::make_pair(map, index)); diff -r c8fa41fcc4a7 -r 699c7eac2c6d lemon/lgf_writer.h --- a/lemon/lgf_writer.h Thu Dec 01 09:05:47 2011 +0100 +++ b/lemon/lgf_writer.h Wed Jan 11 22:21:07 2012 +0100 @@ -1629,7 +1629,7 @@ /// reads the red and blue nodes from separate sections, and these /// sections can contain different set of maps. /// - /// The red and blue maps are written to the corresponding + /// The red and blue node maps are written to the corresponding /// sections. The node maps are written to both of these sections /// with the same map name. template @@ -1805,11 +1805,11 @@ return *this; } - /// \brief Red map writing rule + /// \brief Red node map writing rule /// - /// Add a red map writing rule to the writer. + /// Add a red node map writing rule to the writer. template - BpGraphWriter& redMap(const std::string& caption, const Map& map) { + BpGraphWriter& redNodeMap(const std::string& caption, const Map& map) { checkConcept, Map>(); _writer_bits::MapStorageBase* storage = new _writer_bits::MapStorage(map); @@ -1817,13 +1817,13 @@ return *this; } - /// \brief Red map writing rule + /// \brief Red node map writing rule /// - /// Add a red map writing rule with specialized converter to the + /// Add a red node map writing rule with specialized converter to the /// writer. template - BpGraphWriter& redMap(const std::string& caption, const Map& map, - const Converter& converter = Converter()) { + BpGraphWriter& redNodeMap(const std::string& caption, const Map& map, + const Converter& converter = Converter()) { checkConcept, Map>(); _writer_bits::MapStorageBase* storage = new _writer_bits::MapStorage(map, converter); @@ -1831,11 +1831,11 @@ return *this; } - /// \brief Blue map writing rule + /// \brief Blue node map writing rule /// - /// Add a blue map writing rule to the writer. + /// Add a blue node map writing rule to the writer. template - BpGraphWriter& blueMap(const std::string& caption, const Map& map) { + BpGraphWriter& blueNodeMap(const std::string& caption, const Map& map) { checkConcept, Map>(); _writer_bits::MapStorageBase* storage = new _writer_bits::MapStorage(map); @@ -1843,13 +1843,13 @@ return *this; } - /// \brief Blue map writing rule + /// \brief Blue node map writing rule /// - /// Add a blue map writing rule with specialized converter to the + /// Add a blue node map writing rule with specialized converter to the /// writer. template - BpGraphWriter& blueMap(const std::string& caption, const Map& map, - const Converter& converter = Converter()) { + BpGraphWriter& blueNodeMap(const std::string& caption, const Map& map, + const Converter& converter = Converter()) { checkConcept, Map>(); _writer_bits::MapStorageBase* storage = new _writer_bits::MapStorage(map, converter); @@ -2058,7 +2058,7 @@ *_os << std::endl; std::vector nodes; - for (RedIt n(_graph); n != INVALID; ++n) { + for (RedNodeIt n(_graph); n != INVALID; ++n) { nodes.push_back(n); } @@ -2118,7 +2118,7 @@ *_os << std::endl; std::vector nodes; - for (BlueIt n(_graph); n != INVALID; ++n) { + for (BlueNodeIt n(_graph); n != INVALID; ++n) { nodes.push_back(n); } diff -r c8fa41fcc4a7 -r 699c7eac2c6d test/bpgraph_test.cc --- a/test/bpgraph_test.cc Thu Dec 01 09:05:47 2011 +0100 +++ b/test/bpgraph_test.cc Wed Jan 11 22:21:07 2012 +0100 @@ -101,8 +101,8 @@ checkEdgeIds(G); checkGraphNodeMap(G); - checkGraphRedMap(G); - checkGraphBlueMap(G); + checkGraphRedNodeMap(G); + checkGraphBlueNodeMap(G); checkGraphArcMap(G); checkGraphEdgeMap(G); } @@ -260,8 +260,8 @@ checkEdgeIds(G); checkGraphNodeMap(G); - checkGraphRedMap(G); - checkGraphBlueMap(G); + checkGraphRedNodeMap(G); + checkGraphBlueNodeMap(G); checkGraphArcMap(G); checkGraphEdgeMap(G); @@ -369,13 +369,13 @@ checkGraphEdgeList(G, redNum * blueNum); checkGraphArcList(G, 2 * redNum * blueNum); - for (RedIt n(G); n != INVALID; ++n) { + for (RedNodeIt n(G); n != INVALID; ++n) { checkGraphOutArcList(G, n, blueNum); checkGraphInArcList(G, n, blueNum); checkGraphIncEdgeList(G, n, blueNum); } - for (BlueIt n(G); n != INVALID; ++n) { + for (BlueNodeIt n(G); n != INVALID; ++n) { checkGraphOutArcList(G, n, redNum); checkGraphInArcList(G, n, redNum); checkGraphIncEdgeList(G, n, redNum); @@ -393,8 +393,8 @@ checkEdgeIds(G); checkGraphNodeMap(G); - checkGraphRedMap(G); - checkGraphBlueMap(G); + checkGraphRedNodeMap(G); + checkGraphBlueNodeMap(G); checkGraphArcMap(G); checkGraphEdgeMap(G); diff -r c8fa41fcc4a7 -r 699c7eac2c6d test/graph_copy_test.cc --- a/test/graph_copy_test.cc Thu Dec 01 09:05:47 2011 +0100 +++ b/test/graph_copy_test.cc Wed Jan 11 22:21:07 2012 +0100 @@ -216,8 +216,8 @@ // Build a graph SmartBpGraph from; SmartBpGraph::NodeMap fnm(from); - SmartBpGraph::RedMap frnm(from); - SmartBpGraph::BlueMap fbnm(from); + SmartBpGraph::RedNodeMap frnm(from); + SmartBpGraph::BlueNodeMap fbnm(from); SmartBpGraph::ArcMap fam(from); SmartBpGraph::EdgeMap fem(from); SmartBpGraph::Node fn = INVALID; @@ -261,8 +261,8 @@ // Test graph copy GR to; typename GR::template NodeMap tnm(to); - typename GR::template RedMap trnm(to); - typename GR::template BlueMap tbnm(to); + typename GR::template RedNodeMap trnm(to); + typename GR::template BlueNodeMap tbnm(to); typename GR::template ArcMap tam(to); typename GR::template EdgeMap tem(to); typename GR::Node tn; @@ -272,19 +272,20 @@ typename GR::Edge te; SmartBpGraph::NodeMap nr(from); - SmartBpGraph::RedMap rnr(from); - SmartBpGraph::BlueMap bnr(from); + SmartBpGraph::RedNodeMap rnr(from); + SmartBpGraph::BlueNodeMap bnr(from); SmartBpGraph::ArcMap ar(from); SmartBpGraph::EdgeMap er(from); typename GR::template NodeMap ncr(to); - typename GR::template RedMap rncr(to); - typename GR::template BlueMap bncr(to); + typename GR::template RedNodeMap rncr(to); + typename GR::template BlueNodeMap bncr(to); typename GR::template ArcMap acr(to); typename GR::template EdgeMap ecr(to); bpGraphCopy(from, to). - nodeMap(fnm, tnm).redMap(frnm, trnm).blueMap(fbnm, tbnm). + nodeMap(fnm, tnm). + redNodeMap(frnm, trnm).blueNodeMap(fbnm, tbnm). arcMap(fam, tam).edgeMap(fem, tem). nodeRef(nr).redRef(rnr).blueRef(bnr). arcRef(ar).edgeRef(er). @@ -304,7 +305,7 @@ check(fnm[it] == tnm[nr[it]], "Wrong copy."); } - for (SmartBpGraph::RedIt it(from); it != INVALID; ++it) { + for (SmartBpGraph::RedNodeIt it(from); it != INVALID; ++it) { check(ncr[nr[it]] == it, "Wrong copy."); check(fnm[it] == tnm[nr[it]], "Wrong copy."); check(rnr[it] == nr[it], "Wrong copy."); @@ -313,7 +314,7 @@ check(to.red(rnr[it]), "Wrong copy."); } - for (SmartBpGraph::BlueIt it(from); it != INVALID; ++it) { + for (SmartBpGraph::BlueNodeIt it(from); it != INVALID; ++it) { check(ncr[nr[it]] == it, "Wrong copy."); check(fnm[it] == tnm[nr[it]], "Wrong copy."); check(bnr[it] == nr[it], "Wrong copy."); @@ -343,11 +344,11 @@ for (typename GR::NodeIt it(to); it != INVALID; ++it) { check(nr[ncr[it]] == it, "Wrong copy."); } - for (typename GR::RedIt it(to); it != INVALID; ++it) { + for (typename GR::RedNodeIt it(to); it != INVALID; ++it) { check(rncr[it] == ncr[it], "Wrong copy."); check(rnr[rncr[it]] == it, "Wrong copy."); } - for (typename GR::BlueIt it(to); it != INVALID; ++it) { + for (typename GR::BlueNodeIt it(to); it != INVALID; ++it) { check(bncr[it] == ncr[it], "Wrong copy."); check(bnr[bncr[it]] == it, "Wrong copy."); } diff -r c8fa41fcc4a7 -r 699c7eac2c6d test/graph_test.h --- a/test/graph_test.h Thu Dec 01 09:05:47 2011 +0100 +++ b/test/graph_test.h Wed Jan 11 22:21:07 2012 +0100 @@ -43,7 +43,7 @@ template void checkGraphRedNodeList(const Graph &G, int cnt) { - typename Graph::RedIt n(G); + typename Graph::RedNodeIt n(G); for(int i=0;i void checkGraphBlueNodeList(const Graph &G, int cnt) { - typename Graph::BlueIt n(G); + typename Graph::BlueNodeIt n(G); for(int i=0;i values; - for (typename Graph::RedIt n(G); n != INVALID; ++n) { + for (typename Graph::RedNodeIt n(G); n != INVALID; ++n) { check(G.red(n), "Wrong partition"); check(values.find(G.id(n)) == values.end(), "Wrong id"); check(G.id(n) <= G.maxRedId(), "Wrong maximum id"); @@ -238,7 +238,7 @@ void checkBlueNodeIds(const Graph& G) { typedef typename Graph::BlueNode BlueNode; std::set values; - for (typename Graph::BlueIt n(G); n != INVALID; ++n) { + for (typename Graph::BlueNodeIt n(G); n != INVALID; ++n) { check(G.blue(n), "Wrong partition"); check(values.find(G.id(n)) == values.end(), "Wrong id"); check(G.id(n) <= G.maxBlueId(), "Wrong maximum id"); @@ -304,17 +304,17 @@ } template - void checkGraphRedMap(const Graph& G) { + void checkGraphRedNodeMap(const Graph& G) { typedef typename Graph::Node Node; - typedef typename Graph::RedIt RedIt; + typedef typename Graph::RedNodeIt RedNodeIt; - typedef typename Graph::template RedMap IntRedMap; - IntRedMap map(G, 42); - for (RedIt it(G); it != INVALID; ++it) { + typedef typename Graph::template RedNodeMap IntRedNodeMap; + IntRedNodeMap map(G, 42); + for (RedNodeIt it(G); it != INVALID; ++it) { check(map[it] == 42, "Wrong map constructor."); } int s = 0; - for (RedIt it(G); it != INVALID; ++it) { + for (RedNodeIt it(G); it != INVALID; ++it) { map[it] = 0; check(map[it] == 0, "Wrong operator[]."); map.set(it, s); @@ -322,7 +322,7 @@ ++s; } s = s * (s - 1) / 2; - for (RedIt it(G); it != INVALID; ++it) { + for (RedNodeIt it(G); it != INVALID; ++it) { s -= map[it]; } check(s == 0, "Wrong sum."); @@ -334,17 +334,17 @@ } template - void checkGraphBlueMap(const Graph& G) { + void checkGraphBlueNodeMap(const Graph& G) { typedef typename Graph::Node Node; - typedef typename Graph::BlueIt BlueIt; + typedef typename Graph::BlueNodeIt BlueNodeIt; - typedef typename Graph::template BlueMap IntBlueMap; - IntBlueMap map(G, 42); - for (BlueIt it(G); it != INVALID; ++it) { + typedef typename Graph::template BlueNodeMap IntBlueNodeMap; + IntBlueNodeMap map(G, 42); + for (BlueNodeIt it(G); it != INVALID; ++it) { check(map[it] == 42, "Wrong map constructor."); } int s = 0; - for (BlueIt it(G); it != INVALID; ++it) { + for (BlueNodeIt it(G); it != INVALID; ++it) { map[it] = 0; check(map[it] == 0, "Wrong operator[]."); map.set(it, s); @@ -352,7 +352,7 @@ ++s; } s = s * (s - 1) / 2; - for (BlueIt it(G); it != INVALID; ++it) { + for (BlueNodeIt it(G); it != INVALID; ++it) { s -= map[it]; } check(s == 0, "Wrong sum.");