Commit 1002a620 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a0c65e6e
...@@ -86,6 +86,7 @@ inf = float('inf') ...@@ -86,6 +86,7 @@ inf = float('inf')
import numpy as np import numpy as np
import scipy.optimize import scipy.optimize
import copy
# Tree represents a tree node. # Tree represents a tree node.
...@@ -301,6 +302,7 @@ def Restructure(ztree, newStructure): ...@@ -301,6 +302,7 @@ def Restructure(ztree, newStructure):
# extract bucket nodes. # extract bucket nodes.
zrbucketv = [] # of _NodeInRange zrbucketv = [] # of _NodeInRange
rbucketv = [] # of _NodeInRange rbucketv = [] # of _NodeInRange
rlevelv_orig = copy.copy(rlevelv)
while len(rlevelv) > 0 or len(zrlevelv) > 0: while len(rlevelv) > 0 or len(zrlevelv) > 0:
if len(rlevelv) == 0: if len(rlevelv) == 0:
rlevel = [] rlevel = []
...@@ -335,13 +337,6 @@ def Restructure(ztree, newStructure): ...@@ -335,13 +337,6 @@ def Restructure(ztree, newStructure):
# associate nodes to znodes # associate nodes to znodes
assign(zrlevel, rlevel) assign(zrlevel, rlevel)
"""
if len(zrlevel) == len(rlevel): # map 1-1
for (zrn, rn) in zip(zrlevel, rlevel):
rn.node.Z = zrn.node
else:
panic("TODO")
"""
assert zrlevelv == [] assert zrlevelv == []
assert rlevelv == [] assert rlevelv == []
...@@ -359,16 +354,10 @@ def Restructure(ztree, newStructure): ...@@ -359,16 +354,10 @@ def Restructure(ztree, newStructure):
# associate every bucket to zbucket # associate every bucket to zbucket
assign(zrbucketv, rbucketv) assign(zrbucketv, rbucketv)
"""
if len(zrbucketv) == len(rbucketv):
for (zrbucket, rbucket) in zip(zrbucketv, rbucketv):
rbucket.node.Z = zrbucket.node
else:
panic("TODO")
"""
# set znode states according to established tnew->znode association # set znode states according to established tnew->znode association
rlevelv = rlevelv_orig
for rnodev in rlevelv: for rnodev in rlevelv:
for rn in rnodev: for rn in rnodev:
node = rn.node node = rn.node
......
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