equal
deleted
inserted
replaced
285 /// HypercubeGraph implements a special graph type. The nodes of the |
285 /// HypercubeGraph implements a special graph type. The nodes of the |
286 /// graph are indexed with integers having at most \c dim binary digits. |
286 /// graph are indexed with integers having at most \c dim binary digits. |
287 /// Two nodes are connected in the graph if and only if their indices |
287 /// Two nodes are connected in the graph if and only if their indices |
288 /// differ only on one position in the binary form. |
288 /// differ only on one position in the binary form. |
289 /// This class is completely static and it needs constant memory space. |
289 /// This class is completely static and it needs constant memory space. |
290 /// Thus you can neither add nor delete nodes or edges. |
290 /// Thus you can neither add nor delete nodes or edges, however |
|
291 /// the structure can be resized using resize(). |
291 /// |
292 /// |
292 /// This type fully conforms to the \ref concepts::Graph "Graph concept". |
293 /// This type fully conforms to the \ref concepts::Graph "Graph concept". |
293 /// Most of its member functions and nested classes are documented |
294 /// Most of its member functions and nested classes are documented |
294 /// only in the concept class. |
295 /// only in the concept class. |
295 /// |
296 /// |
303 |
304 |
304 /// \brief Constructs a hypercube graph with \c dim dimensions. |
305 /// \brief Constructs a hypercube graph with \c dim dimensions. |
305 /// |
306 /// |
306 /// Constructs a hypercube graph with \c dim dimensions. |
307 /// Constructs a hypercube graph with \c dim dimensions. |
307 HypercubeGraph(int dim) { construct(dim); } |
308 HypercubeGraph(int dim) { construct(dim); } |
|
309 |
|
310 /// \brief Resizes the graph |
|
311 /// |
|
312 /// This function resizes the graph. It fully destroys and |
|
313 /// rebuilds the structure, therefore the maps of the graph will be |
|
314 /// reallocated automatically and the previous values will be lost. |
|
315 void resize(int dim) { |
|
316 Parent::notifier(Arc()).clear(); |
|
317 Parent::notifier(Edge()).clear(); |
|
318 Parent::notifier(Node()).clear(); |
|
319 construct(dim); |
|
320 Parent::notifier(Node()).build(); |
|
321 Parent::notifier(Edge()).build(); |
|
322 Parent::notifier(Arc()).build(); |
|
323 } |
308 |
324 |
309 /// \brief The number of dimensions. |
325 /// \brief The number of dimensions. |
310 /// |
326 /// |
311 /// Gives back the number of dimensions. |
327 /// Gives back the number of dimensions. |
312 int dimension() const { |
328 int dimension() const { |