lemon/grid_ugraph.h
changeset 2388 c6d537888fe5
parent 2384 805c5a2a36dd
child 2391 14a343be7a5a
equal deleted inserted replaced
13:3a03579b01d5 14:6f127c90d7b4
    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);