Of course I can't rule out some implementation of this that I haven't thought of. If this is important to you, I recommend raising it as an Issue on the gmpy github site I linked; the author of gmpy is quite responsive and should be able to help. Since I'm only the Debian maintainer rather than the upstream maintainer and this is an upstream rather than a packaging bug, there's not much more I can do.
On Wed, Nov 18, 2015 at 12:03 AM, David George Henderson III < d...@pop-server.its.caltech.edu> wrote: > Hi Martin, > > I'm not far enough along to create a performance comparison. > > The immediate functionality is the gram-schmidt factorization of a lattice > basis matrix stored in columns of int32 vectors. The numpy array of objects > are the orthogonalized vectors and the dot product is the time-critical > code to optimize. Please forgive my jargon, its not relevant to the bug. > > It seems plausible that there is a bytecode reference to an int32 array > component that is defined independently of the numpy library. If this is > indeed the case, the gmpy2.xmpz() constructor could be reworked to accept > this datatype as input. After all, Python2 short ints are int32. > > The code I'm writing handles each of native int(), gmpy2.mpz() and > gmpy2.xmpz() objects for the containers for big integer vector components. > Each orthogonalized vector is as an numpy array of object (each object is a > xmpz or other bigint container). > > The gmpy2.xmpz objects are going to have extremely large magnitudes. Its > unclear whether the int(z[i]) is going to be a big hit in performance. What > is clear that I'm going to be recalculating the int32 arrays quite > frequently in each step of lattice basis reduction. > > A numpy dtype=int32 array holds mutable int32 array components. This is > the functionality I'd like to mimic with a numpy dtype=object array where > each object is a mutable xmpz. > > I'll certainly be doing a timing analysis on each implementation > alternative. I'm not counting on the gmpy2.xmpz working because it is > written up as experimental. > > Would you please forward this elaboration to the ultimate maintainer of > gmpy2? > > Thanks in advance, > > David >