Changes in lemon/grid_graph.h [617:4137ef9aacc6:787:c2230649a493] in lemon-1.2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/grid_graph.h
r617 r787 471 471 /// \brief Grid graph class 472 472 /// 473 /// This classimplements a special graph type. The nodes of the474 /// graph can be indexed by two integer \c (i,j) valuewhere \c i is475 /// in the \c [0..width()-1] range and j is in the \c476 /// [0..height()-1] range.Two nodes are connected in the graph if477 /// the ind exes differ exactly on one position and exactly one is478 /// the difference. The nodes of the graph can be indexed by position479 /// with the \c operator()() function. The positions of the nodes can be480 /// get with\c pos(), \c col() and \c row() members. The outgoing473 /// GridGraph implements a special graph type. The nodes of the 474 /// graph can be indexed by two integer values \c (i,j) where \c i is 475 /// in the range <tt>[0..width()-1]</tt> and j is in the range 476 /// <tt>[0..height()-1]</tt>. Two nodes are connected in the graph if 477 /// the indices differ exactly on one position and the difference is 478 /// also exactly one. The nodes of the graph can be obtained by position 479 /// using the \c operator()() function and the indices of the nodes can 480 /// be obtained using \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, however 487 /// the structure can be resized using resize(). 484 488 /// 485 489 /// \image html grid_graph.png … … 497 501 ///\endcode 498 502 /// 499 /// This graph type fully conforms to the \ref concepts::Graph 500 /// "Graph concept". 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. 501 508 class GridGraph : public ExtendedGridGraphBase { 502 509 typedef ExtendedGridGraphBase Parent; … … 504 511 public: 505 512 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>. 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>". 509 518 class IndexMap { 510 519 public: … … 515 524 516 525 /// \brief Constructor 517 ///518 /// Constructor519 526 IndexMap(const GridGraph& graph) : _graph(graph) {} 520 527 521 528 /// \brief The subscript operator 522 ///523 /// The subscript operator.524 529 Value operator[](Key key) const { 525 530 return _graph.pos(key); … … 541 546 542 547 /// \brief Constructor 543 ///544 /// Constructor545 548 ColMap(const GridGraph& graph) : _graph(graph) {} 546 549 547 550 /// \brief The subscript operator 548 ///549 /// The subscript operator.550 551 Value operator[](Key key) const { 551 552 return _graph.col(key); … … 567 568 568 569 /// \brief Constructor 569 ///570 /// Constructor571 570 RowMap(const GridGraph& graph) : _graph(graph) {} 572 571 573 572 /// \brief The subscript operator 574 ///575 /// The subscript operator.576 573 Value operator[](Key key) const { 577 574 return _graph.row(key); … … 584 581 /// \brief Constructor 585 582 /// 586 /// Construct a grid graph with given size.583 /// Construct a grid graph with the given size. 587 584 GridGraph(int width, int height) { construct(width, height); } 588 585 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. 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. 595 591 void resize(int width, int height) { 596 592 Parent::notifier(Arc()).clear(); … … 610 606 } 611 607 612 /// \brief Gives back the column index of the node.608 /// \brief The column index of the node. 613 609 /// 614 610 /// Gives back the column index of the node. … … 617 613 } 618 614 619 /// \brief Gives back the row index of the node.615 /// \brief The row index of the node. 620 616 /// 621 617 /// Gives back the row index of the node. … … 624 620 } 625 621 626 /// \brief Gives back the position of the node.622 /// \brief The position of the node. 627 623 /// 628 624 /// Gives back the position of the node, ie. the <tt>(col,row)</tt> pair. … … 631 627 } 632 628 633 /// \brief Gives back the number of the columns.629 /// \brief The number of the columns. 634 630 /// 635 631 /// Gives back the number of the columns. … … 638 634 } 639 635 640 /// \brief Gives back the number of the rows.636 /// \brief The number of the rows. 641 637 /// 642 638 /// Gives back the number of the rows. … … 645 641 } 646 642 647 /// \brief Gives back the arc goes right from the node.643 /// \brief The arc goes right from the node. 648 644 /// 649 645 /// Gives back the arc goes right from the node. If there is not … … 653 649 } 654 650 655 /// \brief Gives back the arc goes left from the node.651 /// \brief The arc goes left from the node. 656 652 /// 657 653 /// Gives back the arc goes left from the node. If there is not … … 661 657 } 662 658 663 /// \brief Gives back the arc goes up from the node.659 /// \brief The arc goes up from the node. 664 660 /// 665 661 /// Gives back the arc goes up from the node. If there is not … … 669 665 } 670 666 671 /// \brief Gives back the arc goes down from the node.667 /// \brief The arc goes down from the node. 672 668 /// 673 669 /// Gives back the arc goes down from the node. If there is not
Note: See TracChangeset
for help on using the changeset viewer.