Commit b222b803 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0faa50e4
......@@ -250,8 +250,11 @@ def Restructure(ztree, newStructure):
rn.node.Z = None
def D(a, b):
return abs(a.range.klo - b.range.klo) + \
abs(a.range.khi - b.range.khi)
def d(x,y):
if x == y: return 0 # prevents inf-inf -> nan
return abs(x-y)
return d(a.range.klo, b.range.klo) + \
d(a.range.khi, b.range.khi)
# prepare cost matrix
C = np.zeros((len(RNv), len(RZv)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment