equal
deleted
inserted
replaced
47 |
47 |
48 GridUGraphBase() {} |
48 GridUGraphBase() {} |
49 |
49 |
50 protected: |
50 protected: |
51 |
51 |
52 void construct(int width, int height) { |
52 void construct(int w, int h) { |
53 _height = height; _width = width; |
53 _height = h; _width = w; |
54 _nodeNum = height * width; _edgeNum = 2 * _nodeNum - width - height; |
54 _nodeNum = h * w; _edgeNum = 2 * _nodeNum - w - h; |
55 _edgeLimit = _nodeNum - width; |
55 _edgeLimit = _nodeNum - w; |
56 } |
56 } |
57 |
57 |
58 Edge _down(Node n) const { |
58 Edge _down(Node n) const { |
59 if (n.id < _nodeNum - _width) { |
59 if (n.id < _nodeNum - _width) { |
60 return Edge(n.id); |
60 return Edge(n.id); |