fplll / fpylll

A Python interface for https://github.com/fplll/fplll
GNU General Public License v2.0
118 stars 60 forks source link

feature: support slicing for IntegerMatrix #265

Open alxiong opened 7 months ago

alxiong commented 7 months ago

Currently, you cannot use the common slicing to access (read/write) rows/cols of IntegerMatrix, this issue aims to add support for it.

namely:

from fpylll import IntegerMatrix
A = IntegerMatrix.random(10, "uniform", bits=8)
B = IntegerMatrix.random(5, "uniform", bits=8)

C = A[:5] # this will fail
A[5:, 5:] = B # this will also fail

additionally, since IntegerMatrixRow didn't implement __setitem__, we can't even A[2]=B[2], we should also add that in this issue.