54 /// |
54 /// |
55 /// You can assume that all undirected bipartite graph can be handled |
55 /// You can assume that all undirected bipartite graph can be handled |
56 /// as an undirected graph and consequently as a static graph. |
56 /// as an undirected graph and consequently as a static graph. |
57 /// |
57 /// |
58 /// The bipartite graph stores two types of nodes which are named |
58 /// The bipartite graph stores two types of nodes which are named |
59 /// ANode and BNode. Even so the graph type does not contain ANode |
59 /// ANode and BNode. The graph type contains two types ANode and BNode |
60 /// and BNode classes, becaue the nodes can be accessed just with the |
60 /// which are inherited from Node type. Moreover they have |
61 /// common Node class. |
61 /// constructor which converts Node to either ANode or BNode when it is |
|
62 /// possible. Therefor everywhere the Node type can be used instead of |
|
63 /// ANode and BNode. So the usage of the ANode and BNode is suggested. |
62 /// |
64 /// |
63 /// The iteration on the partition can be done with the ANodeIt and |
65 /// The iteration on the partition can be done with the ANodeIt and |
64 /// BNodeIt classes. The node map can be used to map values to the nodes |
66 /// BNodeIt classes. The node map can be used to map values to the nodes |
65 /// and similarly we can use to map values for just the ANodes and |
67 /// and similarly we can use to map values for just the ANodes and |
66 /// BNodes the ANodeMap and BNodeMap template classes. |
68 /// BNodes the ANodeMap and BNodeMap template classes. |
120 /// |
122 /// |
121 /// \bug This is a technical requirement. Do we really need this? |
123 /// \bug This is a technical requirement. Do we really need this? |
122 bool operator<(Node) const { return false; } |
124 bool operator<(Node) const { return false; } |
123 |
125 |
124 }; |
126 }; |
|
127 |
|
128 /// \brief The base type of anode iterators, |
|
129 /// or in other words, the trivial anode iterator. |
|
130 /// |
|
131 /// This is the base type of each anode iterator, |
|
132 /// thus each kind of anode iterator converts to this. |
|
133 /// More precisely each kind of node iterator should be inherited |
|
134 /// from the trivial anode iterator. The ANode class should be used |
|
135 /// only in special cases. Usually the Node type should be used insted |
|
136 /// of it. |
|
137 class ANode { |
|
138 public: |
|
139 /// Default constructor |
|
140 |
|
141 /// @warning The default constructor sets the iterator |
|
142 /// to an undefined value. |
|
143 ANode() { } |
|
144 /// Copy constructor. |
|
145 |
|
146 /// Copy constructor. |
|
147 /// |
|
148 ANode(const ANode&) { } |
|
149 |
|
150 /// Construct the same node as ANode. |
|
151 |
|
152 /// Construct the same node as ANode. It may throws assertion |
|
153 /// when the given node is from the BNode set. |
|
154 ANode(const Node&) { } |
|
155 |
|
156 /// Invalid constructor \& conversion. |
|
157 |
|
158 /// This constructor initializes the iterator to be invalid. |
|
159 /// \sa Invalid for more details. |
|
160 ANode(Invalid) { } |
|
161 /// Equality operator |
|
162 |
|
163 /// Two iterators are equal if and only if they point to the |
|
164 /// same object or both are invalid. |
|
165 bool operator==(ANode) const { return true; } |
|
166 |
|
167 /// Inequality operator |
|
168 |
|
169 /// \sa operator==(ANode n) |
|
170 /// |
|
171 bool operator!=(ANode) const { return true; } |
|
172 |
|
173 /// Artificial ordering operator. |
|
174 |
|
175 /// To allow the use of graph descriptors as key type in std::map or |
|
176 /// similar associative container we require this. |
|
177 /// |
|
178 /// \note This operator only have to define some strict ordering of |
|
179 /// the items; this order has nothing to do with the iteration |
|
180 /// ordering of the items. |
|
181 bool operator<(ANode) const { return false; } |
|
182 |
|
183 }; |
|
184 |
|
185 /// \brief The base type of bnode iterators, |
|
186 /// or in other words, the trivial bnode iterator. |
|
187 /// |
|
188 /// This is the base type of each anode iterator, |
|
189 /// thus each kind of anode iterator converts to this. |
|
190 /// More precisely each kind of node iterator should be inherited |
|
191 /// from the trivial anode iterator. The BNode class should be used |
|
192 /// only in special cases. Usually the Node type should be used insted |
|
193 /// of it. |
|
194 class BNode { |
|
195 public: |
|
196 /// Default constructor |
|
197 |
|
198 /// @warning The default constructor sets the iterator |
|
199 /// to an undefined value. |
|
200 BNode() { } |
|
201 /// Copy constructor. |
|
202 |
|
203 /// Copy constructor. |
|
204 /// |
|
205 BNode(const BNode&) { } |
|
206 |
|
207 /// Construct the same node as BNode. |
|
208 |
|
209 /// Construct the same node as BNode. It may throws assertion |
|
210 /// when the given node is from the ANode set. |
|
211 BNode(const Node&) { } |
|
212 |
|
213 /// Invalid constructor \& conversion. |
|
214 |
|
215 /// This constructor initializes the iterator to be invalid. |
|
216 /// \sa Invalid for more details. |
|
217 BNode(Invalid) { } |
|
218 /// Equality operator |
|
219 |
|
220 /// Two iterators are equal if and only if they point to the |
|
221 /// same object or both are invalid. |
|
222 bool operator==(BNode) const { return true; } |
|
223 |
|
224 /// Inequality operator |
|
225 |
|
226 /// \sa operator==(BNode n) |
|
227 /// |
|
228 bool operator!=(BNode) const { return true; } |
|
229 |
|
230 /// Artificial ordering operator. |
|
231 |
|
232 /// To allow the use of graph descriptors as key type in std::map or |
|
233 /// similar associative container we require this. |
|
234 /// |
|
235 /// \note This operator only have to define some strict ordering of |
|
236 /// the items; this order has nothing to do with the iteration |
|
237 /// ordering of the items. |
|
238 bool operator<(BNode) const { return false; } |
|
239 |
|
240 }; |
125 |
241 |
126 /// This iterator goes through each node. |
242 /// This iterator goes through each node. |
127 |
243 |
128 /// This iterator goes through each node. |
244 /// This iterator goes through each node. |
129 /// Its usage is quite simple, for example you can count the number |
245 /// Its usage is quite simple, for example you can count the number |