Changeset 1194:699c7eac2c6d in lemon for lemon/concepts/bpgraph.h
- Timestamp:
- 01/11/12 22:21:07 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/concepts/bpgraph.h
r1193 r1194 49 49 /// "undirected graphs". Bipartite graphs provide a bipartition of 50 50 /// the node set, namely a red and blue set of the nodes. The 51 /// nodes can be iterated with the Red It and BlueIt in the two52 /// node sets. With RedMap and BlueMap values can be assigned to53 /// the nodes in the two sets.51 /// nodes can be iterated with the RedNodeIt and BlueNodeIt in the 52 /// two node sets. With RedNodeMap and BlueNodeMap values can be 53 /// assigned to the nodes in the two sets. 54 54 /// 55 55 /// The edges of the graph cannot connect two nodes of the same … … 188 188 /// for (BpGraph::RedNodeIt n(g); n!=INVALID; ++n) ++count; 189 189 ///\endcode 190 class Red It : public RedNode {190 class RedNodeIt : public RedNode { 191 191 public: 192 192 /// Default constructor … … 194 194 /// Default constructor. 195 195 /// \warning It sets the iterator to an undefined value. 196 Red It() { }197 /// Copy constructor. 198 199 /// Copy constructor. 200 /// 201 Red It(const RedIt& n) : RedNode(n) { }196 RedNodeIt() { } 197 /// Copy constructor. 198 199 /// Copy constructor. 200 /// 201 RedNodeIt(const RedNodeIt& n) : RedNode(n) { } 202 202 /// %Invalid constructor \& conversion. 203 203 204 204 /// Initializes the iterator to be invalid. 205 205 /// \sa Invalid for more details. 206 Red It(Invalid) { }206 RedNodeIt(Invalid) { } 207 207 /// Sets the iterator to the first red node. 208 208 209 209 /// Sets the iterator to the first red node of the given 210 210 /// digraph. 211 explicit Red It(const BpGraph&) { }211 explicit RedNodeIt(const BpGraph&) { } 212 212 /// Sets the iterator to the given red node. 213 213 214 214 /// Sets the iterator to the given red node of the given 215 215 /// digraph. 216 Red It(const BpGraph&, const RedNode&) { }216 RedNodeIt(const BpGraph&, const RedNode&) { } 217 217 /// Next node. 218 218 219 219 /// Assign the iterator to the next red node. 220 220 /// 221 Red It& operator++() { return *this; }221 RedNodeIt& operator++() { return *this; } 222 222 }; 223 223 … … 231 231 /// for (BpGraph::BlueNodeIt n(g); n!=INVALID; ++n) ++count; 232 232 ///\endcode 233 class Blue It : public BlueNode {233 class BlueNodeIt : public BlueNode { 234 234 public: 235 235 /// Default constructor … … 237 237 /// Default constructor. 238 238 /// \warning It sets the iterator to an undefined value. 239 Blue It() { }240 /// Copy constructor. 241 242 /// Copy constructor. 243 /// 244 Blue It(const BlueIt& n) : BlueNode(n) { }239 BlueNodeIt() { } 240 /// Copy constructor. 241 242 /// Copy constructor. 243 /// 244 BlueNodeIt(const BlueNodeIt& n) : BlueNode(n) { } 245 245 /// %Invalid constructor \& conversion. 246 246 247 247 /// Initializes the iterator to be invalid. 248 248 /// \sa Invalid for more details. 249 Blue It(Invalid) { }249 BlueNodeIt(Invalid) { } 250 250 /// Sets the iterator to the first blue node. 251 251 252 252 /// Sets the iterator to the first blue node of the given 253 253 /// digraph. 254 explicit Blue It(const BpGraph&) { }254 explicit BlueNodeIt(const BpGraph&) { } 255 255 /// Sets the iterator to the given blue node. 256 256 257 257 /// Sets the iterator to the given blue node of the given 258 258 /// digraph. 259 Blue It(const BpGraph&, const BlueNode&) { }259 BlueNodeIt(const BpGraph&, const BlueNode&) { } 260 260 /// Next node. 261 261 262 262 /// Assign the iterator to the next blue node. 263 263 /// 264 Blue It& operator++() { return *this; }264 BlueNodeIt& operator++() { return *this; } 265 265 }; 266 266 … … 664 664 /// It conforms to the ReferenceMap concept. 665 665 template<class T> 666 class Red Map : public ReferenceMap<Node, T, T&, const T&>666 class RedNodeMap : public ReferenceMap<Node, T, T&, const T&> 667 667 { 668 668 public: 669 669 670 670 /// Constructor 671 explicit Red Map(const BpGraph&) { }671 explicit RedNodeMap(const BpGraph&) { } 672 672 /// Constructor with given initial value 673 Red Map(const BpGraph&, T) { }673 RedNodeMap(const BpGraph&, T) { } 674 674 675 675 private: 676 676 ///Copy constructor 677 Red Map(const RedMap& nm) :677 RedNodeMap(const RedNodeMap& nm) : 678 678 ReferenceMap<Node, T, T&, const T&>(nm) { } 679 679 ///Assignment operator 680 680 template <typename CMap> 681 Red Map& operator=(const CMap&) {681 RedNodeMap& operator=(const CMap&) { 682 682 checkConcept<ReadMap<Node, T>, CMap>(); 683 683 return *this; … … 690 690 /// It conforms to the ReferenceMap concept. 691 691 template<class T> 692 class Blue Map : public ReferenceMap<Node, T, T&, const T&>692 class BlueNodeMap : public ReferenceMap<Node, T, T&, const T&> 693 693 { 694 694 public: 695 695 696 696 /// Constructor 697 explicit Blue Map(const BpGraph&) { }697 explicit BlueNodeMap(const BpGraph&) { } 698 698 /// Constructor with given initial value 699 Blue Map(const BpGraph&, T) { }699 BlueNodeMap(const BpGraph&, T) { } 700 700 701 701 private: 702 702 ///Copy constructor 703 Blue Map(const BlueMap& nm) :703 BlueNodeMap(const BlueNodeMap& nm) : 704 704 ReferenceMap<Node, T, T&, const T&>(nm) { } 705 705 ///Assignment operator 706 706 template <typename CMap> 707 Blue Map& operator=(const CMap&) {707 BlueNodeMap& operator=(const CMap&) { 708 708 checkConcept<ReadMap<Node, T>, CMap>(); 709 709 return *this;
Note: See TracChangeset
for help on using the changeset viewer.