| ... | ... |
@@ -460,49 +460,49 @@ |
| 460 | 460 |
int _node_num, _edge_num; |
| 461 | 461 |
int _edge_limit; |
| 462 | 462 |
}; |
| 463 | 463 |
|
| 464 | 464 |
|
| 465 | 465 |
typedef GraphExtender<GridGraphBase> ExtendedGridGraphBase; |
| 466 | 466 |
|
| 467 | 467 |
/// \ingroup graphs |
| 468 | 468 |
/// |
| 469 | 469 |
/// \brief Grid graph class |
| 470 | 470 |
/// |
| 471 | 471 |
/// This class implements a special graph type. The nodes of the |
| 472 | 472 |
/// graph can be indexed by two integer \c (i,j) value where \c i is |
| 473 | 473 |
/// in the \c [0..width()-1] range and j is in the \c |
| 474 | 474 |
/// [0..height()-1] range. Two nodes are connected in the graph if |
| 475 | 475 |
/// the indexes differ exactly on one position and exactly one is |
| 476 | 476 |
/// the difference. The nodes of the graph can be indexed by position |
| 477 | 477 |
/// with the \c operator()() function. The positions of the nodes can be |
| 478 | 478 |
/// get with \c pos(), \c col() and \c row() members. The outgoing |
| 479 | 479 |
/// arcs can be retrieved with the \c right(), \c up(), \c left() |
| 480 | 480 |
/// and \c down() functions, where the bottom-left corner is the |
| 481 | 481 |
/// origin. |
| 482 | 482 |
/// |
| 483 | 483 |
/// \image html grid_graph.png |
| 484 |
/// \image latex grid_graph.eps "Grid graph" |
|
| 484 |
/// \image latex grid_graph.eps "Grid graph" width=\textwidth |
|
| 485 | 485 |
/// |
| 486 | 486 |
/// A short example about the basic usage: |
| 487 | 487 |
///\code |
| 488 | 488 |
/// GridGraph graph(rows, cols); |
| 489 | 489 |
/// GridGraph::NodeMap<int> val(graph); |
| 490 | 490 |
/// for (int i = 0; i < graph.width(); ++i) {
|
| 491 | 491 |
/// for (int j = 0; j < graph.height(); ++j) {
|
| 492 | 492 |
/// val[graph(i, j)] = i + j; |
| 493 | 493 |
/// } |
| 494 | 494 |
/// } |
| 495 | 495 |
///\endcode |
| 496 | 496 |
/// |
| 497 | 497 |
/// This graph type is fully conform to the \ref concepts::Graph |
| 498 | 498 |
/// "Graph" concept, and it also has an important extra feature |
| 499 | 499 |
/// that its maps are real \ref concepts::ReferenceMap |
| 500 | 500 |
/// "reference map"s. |
| 501 | 501 |
class GridGraph : public ExtendedGridGraphBase {
|
| 502 | 502 |
public: |
| 503 | 503 |
|
| 504 | 504 |
typedef ExtendedGridGraphBase Parent; |
| 505 | 505 |
|
| 506 | 506 |
/// \brief Map to get the indices of the nodes as dim2::Point<int>. |
| 507 | 507 |
/// |
| 508 | 508 |
/// Map to get the indices of the nodes as dim2::Point<int>. |
0 comments (0 inline)