minor fixes and optim
This commit is contained in:
parent
d4f92fbcfb
commit
1473633a11
1 changed files with 9 additions and 11 deletions
14
chop/util.py
14
chop/util.py
|
|
@ -73,9 +73,6 @@ def find_faces(neighbors: numpy.ndarray) -> List[numpy.ndarray]:
|
|||
v_current = v_start.copy()
|
||||
v_next = neighbors[v_current, nxt_edge]
|
||||
|
||||
mask = v_start # dummy for loop init, could use numpy.array([True]) instead
|
||||
remove = numpy.zeros_like(edge_id, dtype=bool)
|
||||
|
||||
'''
|
||||
Choose a method for storing the face info based on expected
|
||||
runtime vs unnecessary memory allocation
|
||||
|
|
@ -115,9 +112,10 @@ def find_faces(neighbors: numpy.ndarray) -> List[numpy.ndarray]:
|
|||
b) we reach the original vertex (stop, done with this path)
|
||||
'''
|
||||
k = 1
|
||||
#init_mask = v_next > v_current
|
||||
#v = numpy.vstack((edge_id, v_start, v_current, v_next))[:, init_mask]
|
||||
v = numpy.vstack((edge_id, v_start, v_current, v_next))
|
||||
mask = v_next > v_current
|
||||
v = numpy.vstack((edge_id, v_start, v_current, v_next))[:, mask]
|
||||
remove = numpy.logical_not(mask)
|
||||
|
||||
while mask.any():
|
||||
add_edges(v[0], v[3], k)
|
||||
|
||||
|
|
@ -182,12 +180,12 @@ def _get_maps(a, b):
|
|||
@profile
|
||||
def _get_maps_rows(a, b):
|
||||
'''
|
||||
Row-wise _get_map_2way
|
||||
Row-wise _get_maps
|
||||
'''
|
||||
dims = numpy.maximum(a.max(0), b.max(0)) + 1
|
||||
a1d = numpy.ravel_multi_index(a.T, dims)
|
||||
b1d = numpy.ravel_multi_index(b.T, dims)
|
||||
return _get_map(a1d, b1d)
|
||||
return _get_maps(a1d, b1d)
|
||||
|
||||
|
||||
def _argsort_rows(a):
|
||||
|
|
|
|||
Loading…
Reference in a new issue