Lines Matching refs:W
83 def getNthPairBounded(N,W=aleph0,H=aleph0,useDivmod=False): argument
88 if W <= 0 or H <= 0:
90 elif N >= W*H:
94 if W is aleph0 and H is aleph0:
98 if H < W:
99 x,y = getNthPairBounded(N,H,W,useDivmod=useDivmod)
103 return N%W,N//W
110 cornerSize = base(W)
116 M = W*H - N - 1
119 return (W-1-x,H-1-y)
124 index,offset = N%W,N//W
126 return (W-1-index, 1+offset+index)
127 def getNthPairBoundedChecked(N,W=aleph0,H=aleph0,useDivmod=False,GNP=getNthPairBounded): argument
128 x,y = GNP(N,W,H,useDivmod)
129 assert 0 <= x < W and 0 <= y < H
132 def getNthNTuple(N, W, H=aleph0, useLeftToRight=False): argument
138 elts = [None]*W
139 for i in range(W):
143 if W==0:
145 elif W==1:
147 elif W==2:
150 LW,RW = W//2, W - (W//2)
154 def getNthNTupleChecked(N, W, H=aleph0, useLeftToRight=False, GNT=getNthNTuple): argument
155 t = GNT(N,W,H,useLeftToRight)
156 assert len(t) == W
206 W = len(active) - i
211 levelSize = W*H
213 idelta,delta = getNthPairBounded(N, W, H)
229 W = 3
233 for i in range(min(W*H,40)):
234 x,y = getNthPairBounded(i,W,H)
235 x2,y2 = getNthPairBounded(i,W,H,useDivmod=True)