Closed verdiverdiverdi closed 1 year ago
It's not quite clear to me what should happen here. Would we just round?
Apologies, I meant e.g.
import numpy as np
from fpylll import IntegerMatrix
B = np.eye(5, dtype=np.int32)
Bfpy = IntegerMatrix.from_matrix(B)
which gives
NotImplementedError: Type '<class 'numpy.int32'>' not supported
which seems true for all integer types numpy understands.
I guess the solution is just to do this casting to a python integer "behind the scenes" in these cases?
Yup, I agree with that. Shouldn't be too hard to add.
gives
NotImplementedError: Type '<class 'numpy.float64'>' not supported
that ultimately comes from set_matrix calling _set (here) which calls assign_mpz (here).
This is not the end of the world, as one can do double list comprehension and cast to a python int -- but it would be nice if from_matrix supported numpy arrays natively.