Changeset 1193:c8fa41fcc4a7 in lemon for lemon/concepts/bpgraph.h
- Timestamp:
- 12/01/11 09:05:47 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/concepts/bpgraph.h
r1186 r1193 150 150 RedNode(Invalid) { } 151 151 152 /// Constructor for conversion from a node.153 154 /// Constructor for conversion from a node. The conversion can155 /// be invalid, since the Node can be member of the blue156 /// set.157 RedNode(const Node&) {}158 152 }; 159 153 … … 183 177 BlueNode(Invalid) { } 184 178 185 /// Constructor for conversion from a node.186 187 /// Constructor for conversion from a node. The conversion can188 /// be invalid, since the Node can be member of the red189 /// set.190 BlueNode(const Node&) {}191 179 }; 192 180 … … 200 188 /// for (BpGraph::RedNodeIt n(g); n!=INVALID; ++n) ++count; 201 189 ///\endcode 202 class RedIt : public Node {190 class RedIt : public RedNode { 203 191 public: 204 192 /// Default constructor … … 211 199 /// Copy constructor. 212 200 /// 213 RedIt(const RedIt& n) : Node(n) { }201 RedIt(const RedIt& n) : RedNode(n) { } 214 202 /// %Invalid constructor \& conversion. 215 203 … … 226 214 /// Sets the iterator to the given red node of the given 227 215 /// digraph. 228 RedIt(const BpGraph&, const Node&) { }216 RedIt(const BpGraph&, const RedNode&) { } 229 217 /// Next node. 230 218 … … 243 231 /// for (BpGraph::BlueNodeIt n(g); n!=INVALID; ++n) ++count; 244 232 ///\endcode 245 class BlueIt : public Node {233 class BlueIt : public BlueNode { 246 234 public: 247 235 /// Default constructor … … 254 242 /// Copy constructor. 255 243 /// 256 BlueIt(const BlueIt& n) : Node(n) { }244 BlueIt(const BlueIt& n) : BlueNode(n) { } 257 245 /// %Invalid constructor \& conversion. 258 246 … … 269 257 /// Sets the iterator to the given blue node of the given 270 258 /// digraph. 271 BlueIt(const BpGraph&, const Node&) { }259 BlueIt(const BpGraph&, const BlueNode&) { } 272 260 /// Next node. 273 261 … … 785 773 bool blue(const Node&) const { return true; } 786 774 775 /// \brief Converts the node to red node object. 776 /// 777 /// This class is converts unsafely the node to red node 778 /// object. It should be called only if the node is from the red 779 /// partition or INVALID. 780 RedNode asRedNodeUnsafe(const Node&) const { return RedNode(); } 781 782 /// \brief Converts the node to blue node object. 783 /// 784 /// This class is converts unsafely the node to blue node 785 /// object. It should be called only if the node is from the red 786 /// partition or INVALID. 787 BlueNode asBlueNodeUnsafe(const Node&) const { return BlueNode(); } 788 789 /// \brief Converts the node to red node object. 790 /// 791 /// This class is converts safely the node to red node 792 /// object. If the node is not from the red partition, then it 793 /// returns INVALID. 794 RedNode asRedNode(const Node&) const { return RedNode(); } 795 796 /// \brief Converts the node to blue node object. 797 /// 798 /// This class is converts unsafely the node to blue node 799 /// object. If the node is not from the blue partition, then it 800 /// returns INVALID. 801 BlueNode asBlueNode(const Node&) const { return BlueNode(); } 802 803 /// \brief Convert the node to either red or blue node. 804 /// 805 /// If the node is from the red partition then it is returned in 806 /// first and second is INVALID. If the node is from the blue 807 /// partition then it is returned in second and first is 808 /// INVALID. If the node INVALID then both first and second are 809 /// INVALID in the return value. 810 std::pair<RedNode, BlueNode> asRedBlueNode(const Node&) const { 811 return std::make_pair(RedNode(), BlueNode()); 812 } 813 787 814 /// \brief Gives back the red end node of the edge. 788 815 /// 789 816 /// Gives back the red end node of the edge. 790 Node redNode(const Edge&) const { returnNode(); }817 RedNode redNode(const Edge&) const { return RedNode(); } 791 818 792 819 /// \brief Gives back the blue end node of the edge. 793 820 /// 794 821 /// Gives back the blue end node of the edge. 795 Node blueNode(const Edge&) const { returnNode(); }822 BlueNode blueNode(const Edge&) const { return BlueNode(); } 796 823 797 824 /// \brief The first node of the edge. … … 823 850 /// 824 851 /// Returns the red ID of the given node. 825 int redId(Node) const { return -1; }826 827 /// \brief The red ID of the node.828 ///829 /// Returns the red ID of the given node.830 852 int id(RedNode) const { return -1; } 831 832 /// \brief The blue ID of the node.833 ///834 /// Returns the blue ID of the given node.835 int blueId(Node) const { return -1; }836 853 837 854 /// \brief The blue ID of the node. … … 929 946 void next(Node&) const {} 930 947 931 void firstRed( Node&) const {}932 void nextRed( Node&) const {}933 934 void firstBlue( Node&) const {}935 void nextBlue( Node&) const {}948 void firstRed(RedNode&) const {} 949 void nextRed(RedNode&) const {} 950 951 void firstBlue(BlueNode&) const {} 952 void nextBlue(BlueNode&) const {} 936 953 937 954 void first(Edge&) const {}
Note: See TracChangeset
for help on using the changeset viewer.