Changes in lemon/grid_graph.h [834:c2230649a493:664:4137ef9aacc6] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/grid_graph.h
r834 r664 471 471 /// \brief Grid graph class 472 472 /// 473 /// GridGraphimplements a special graph type. The nodes of the474 /// graph can be indexed by two integer values \c (i,j)where \c i is475 /// in the range <tt>[0..width()-1]</tt> and j is in the range476 /// <tt>[0..height()-1]</tt>.Two nodes are connected in the graph if477 /// the ind ices differ exactly on one position and the difference is478 /// also exactly one. The nodes of the graph can be obtained by position479 /// using the \c operator()() function and the indices of the nodes can480 /// be obtained using\c pos(), \c col() and \c row() members. The outgoing473 /// This class implements a special graph type. The nodes of the 474 /// graph can be indexed by two integer \c (i,j) value where \c i is 475 /// in the \c [0..width()-1] range and j is in the \c 476 /// [0..height()-1] range. Two nodes are connected in the graph if 477 /// the indexes differ exactly on one position and exactly one is 478 /// the difference. The nodes of the graph can be indexed by position 479 /// with the \c operator()() function. The positions of the nodes can be 480 /// get with \c pos(), \c col() and \c row() members. The outgoing 481 481 /// arcs can be retrieved with the \c right(), \c up(), \c left() 482 482 /// and \c down() functions, where the bottom-left corner is the 483 483 /// origin. 484 ///485 /// This class is completely static and it needs constant memory space.486 /// Thus you can neither add nor delete nodes or edges, however487 /// the structure can be resized using resize().488 484 /// 489 485 /// \image html grid_graph.png … … 501 497 ///\endcode 502 498 /// 503 /// This type fully conforms to the \ref concepts::Graph "Graph concept". 504 /// Most of its member functions and nested classes are documented 505 /// only in the concept class. 506 /// 507 /// This class provides constant time counting for nodes, edges and arcs. 499 /// This graph type fully conforms to the \ref concepts::Graph 500 /// "Graph concept". 508 501 class GridGraph : public ExtendedGridGraphBase { 509 502 typedef ExtendedGridGraphBase Parent; … … 511 504 public: 512 505 513 /// \brief Map to get the indices of the nodes as \ref dim2::Point 514 /// "dim2::Point<int>". 515 /// 516 /// Map to get the indices of the nodes as \ref dim2::Point 517 /// "dim2::Point<int>". 506 /// \brief Map to get the indices of the nodes as dim2::Point<int>. 507 /// 508 /// Map to get the indices of the nodes as dim2::Point<int>. 518 509 class IndexMap { 519 510 public: … … 524 515 525 516 /// \brief Constructor 517 /// 518 /// Constructor 526 519 IndexMap(const GridGraph& graph) : _graph(graph) {} 527 520 528 521 /// \brief The subscript operator 522 /// 523 /// The subscript operator. 529 524 Value operator[](Key key) const { 530 525 return _graph.pos(key); … … 546 541 547 542 /// \brief Constructor 543 /// 544 /// Constructor 548 545 ColMap(const GridGraph& graph) : _graph(graph) {} 549 546 550 547 /// \brief The subscript operator 548 /// 549 /// The subscript operator. 551 550 Value operator[](Key key) const { 552 551 return _graph.col(key); … … 568 567 569 568 /// \brief Constructor 569 /// 570 /// Constructor 570 571 RowMap(const GridGraph& graph) : _graph(graph) {} 571 572 572 573 /// \brief The subscript operator 574 /// 575 /// The subscript operator. 573 576 Value operator[](Key key) const { 574 577 return _graph.row(key); … … 581 584 /// \brief Constructor 582 585 /// 583 /// Construct a grid graph with thegiven size.586 /// Construct a grid graph with given size. 584 587 GridGraph(int width, int height) { construct(width, height); } 585 588 586 /// \brief Resizes the graph 587 /// 588 /// This function resizes the graph. It fully destroys and 589 /// rebuilds the structure, therefore the maps of the graph will be 590 /// reallocated automatically and the previous values will be lost. 589 /// \brief Resize the graph 590 /// 591 /// Resize the graph. The function will fully destroy and rebuild 592 /// the graph. This cause that the maps of the graph will 593 /// reallocated automatically and the previous values will be 594 /// lost. 591 595 void resize(int width, int height) { 592 596 Parent::notifier(Arc()).clear(); … … 606 610 } 607 611 608 /// \brief The column index of the node.612 /// \brief Gives back the column index of the node. 609 613 /// 610 614 /// Gives back the column index of the node. … … 613 617 } 614 618 615 /// \brief The row index of the node.619 /// \brief Gives back the row index of the node. 616 620 /// 617 621 /// Gives back the row index of the node. … … 620 624 } 621 625 622 /// \brief The position of the node.626 /// \brief Gives back the position of the node. 623 627 /// 624 628 /// Gives back the position of the node, ie. the <tt>(col,row)</tt> pair. … … 627 631 } 628 632 629 /// \brief The number of the columns.633 /// \brief Gives back the number of the columns. 630 634 /// 631 635 /// Gives back the number of the columns. … … 634 638 } 635 639 636 /// \brief The number of the rows.640 /// \brief Gives back the number of the rows. 637 641 /// 638 642 /// Gives back the number of the rows. … … 641 645 } 642 646 643 /// \brief The arc goes right from the node.647 /// \brief Gives back the arc goes right from the node. 644 648 /// 645 649 /// Gives back the arc goes right from the node. If there is not … … 649 653 } 650 654 651 /// \brief The arc goes left from the node.655 /// \brief Gives back the arc goes left from the node. 652 656 /// 653 657 /// Gives back the arc goes left from the node. If there is not … … 657 661 } 658 662 659 /// \brief The arc goes up from the node.663 /// \brief Gives back the arc goes up from the node. 660 664 /// 661 665 /// Gives back the arc goes up from the node. If there is not … … 665 669 } 666 670 667 /// \brief The arc goes down from the node.671 /// \brief Gives back the arc goes down from the node. 668 672 /// 669 673 /// Gives back the arc goes down from the node. If there is not
Note: See TracChangeset
for help on using the changeset viewer.