• Home
  • Raw
  • Download

Lines Matching refs:delta

39 def iup_contour(delta, coords):  argument
40 assert len(delta) == len(coords)
41 if None not in delta:
42 return delta
44 n = len(delta)
46 indices = [i for i,v in enumerate(delta) if v is not None]
57 out.extend(iup_segment(coords[i1:i2], coords[ri1], delta[ri1], coords[ri2], delta[ri2]))
58 out.append(delta[start])
62 out.extend(iup_segment(coords[i1:i2], coords[ri1], delta[ri1], coords[ri2], delta[ri2]))
63 out.append(delta[end])
68 out.extend(iup_segment(coords[i1:i2], coords[ri1], delta[ri1], coords[ri2], delta[ri2]))
70 assert len(delta) == len(out), (len(delta), len(out))
73 def iup_delta(delta, coords, ends): argument
81 contour = iup_contour(delta[start:end], coords[start:end])
98 def _iup_contour_bound_forced_set(delta, coords, tolerance=0): argument
106 assert len(delta) == len(coords)
110 nd, nc = delta[0], coords[0]
111 ld, lc = delta[-1], coords[-1]
112 for i in range(len(delta)-1, -1, -1):
114 ld, lc = delta[i-1], coords[i-1]
166 def _iup_contour_optimize_dp(delta, coords, forced={}, tolerance=0, lookback=None): argument
176 n = len(delta)
194 if cost < best_cost and can_iup_in_between(delta, coords, j, i, tolerance):
216 def iup_contour_optimize(delta, coords, tolerance=0.): argument
217 n = len(delta)
222 if all(abs(complex(*p)) <= tolerance for p in delta):
227 return delta
230 d0 = delta[0]
231 if all(d0 == d for d in delta):
236 forced = _iup_contour_bound_forced_set(delta, coords, tolerance)
248 delta = _rot_list(delta, k)
252 chain, costs = _iup_contour_optimize_dp(delta, coords, forced, tolerance)
261 delta = [delta[i] if i in solution else None for i in range(n)]
263 delta = _rot_list(delta, -k)
268 chain, costs = _iup_contour_optimize_dp(delta+delta, coords+coords, forced, tolerance, n)
283 delta = [delta[i] if i in best_sol else None for i in range(n)]
286 return delta
288 def iup_delta_optimize(delta, coords, ends, tolerance=0.): argument
295 contour = iup_contour_optimize(delta[start:end+1], coords[start:end+1], tolerance)