# HG changeset patch # User deba # Date 1134583863 0 # Node ID 075aaa0a4e6f5b777d926c0cd956825cf316e538 # Parent a5b6d941ed52fd3df70ccc96084f026394abda7c Bug fix and doc fix diff -r a5b6d941ed52 -r 075aaa0a4e6f lemon/grid_graph.h --- a/lemon/grid_graph.h Wed Dec 14 18:07:28 2005 +0000 +++ b/lemon/grid_graph.h Wed Dec 14 18:11:03 2005 +0000 @@ -228,7 +228,7 @@ /// It finds the first edge from \c u to \c v. Otherwise it looks for /// the next edge from \c u to \c v after \c prev. /// \return The found edge or INVALID if there is no such an edge. - Edge findEdge(Node u, Node v, Edge prev = INVALID) { + Edge findEdge(Node u, Node v, Edge prev = INVALID) const { if (prev != INVALID) return INVALID; if (v.id - u.id == _width) return Edge(u.id); if (v.id - u.id == 1 && u.id % _width < _width - 1) { @@ -349,13 +349,13 @@ /// /// This class implements a special graph type. The nodes of the /// graph can be indiced by two integer \c (i,j) value where \c i - /// is in the \c [0,height) range and j is in the [0, width) range. + /// is in the \c [0,width) range and j is in the [0, height) range. /// Two nodes are connected in the graph if the indices differ only /// on one position and only one is the difference. /// /// The graph can be indiced in the following way: /// \code - /// GridGraph graph(h, w); + /// GridGraph graph(w, h); /// GridGraph::NodeMap val(graph); /// for (int i = 0; i < graph.width(); ++i) { /// for (int j = 0; j < graph.height(); ++j) { @@ -453,6 +453,9 @@ const GridGraph& graph; }; + /// \brief Constructor + /// + /// GridGraph(int n, int m) { construct(n, m); } /// \brief Gives back the edge goes down from the node.