Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3fda17ae authored by hhakim's avatar hhakim
Browse files

Fix pyfaust fancy idx bug on py2.7.

Now the .exe (nsi installer) when installed with Py2.7 on PATH gives a pyfaust working for both slicing and fancy/vector indexing.

Solve partly issue #105.
parent 36756863
Branches
Tags 2.4.19
No related merge requests found
Pipeline #833869 skipped
......@@ -629,8 +629,15 @@ cdef class FaustCore:
if(isinstance(indices[i], slice)):
indices[i] = list(range(indices[i].start, indices[i].stop,
indices[i].step))
row_indices = np.array(indices[0], dtype=np.uint64)
col_indices = np.array(indices[1], dtype=np.uint64)
# it's possible that on certain architectures unsigned long int is a
# 4-bytes integer
# TODO: move to a cross-platform size type (like uint32/64_t from stdlib.h)
if(sizeof(unsigned long int) == 8):
dtype = np.uint64
elif(sizeof(unsigned long int) == 4):
dtype = np.uint32
row_indices = np.array(indices[0], dtype=dtype)
col_indices = np.array(indices[1], dtype=dtype)
row_indices_view = row_indices
col_indices_view = col_indices
# print("FaustCorePy.fancy_idx(), row_indices=", row_indices, " size=",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment