This patch lowers the maximum size of Matrix_modn_dense to 15.5 bits, whereas as it is written it should be able to handle all the way up to 31.5 bits. The issue is that some logic is needed to decide between IntegerMod_int64 and IntegerMod_int. I just outsourced the logic to the basering (where I know it will be handled consistently.
multi-modular methods work best for just under 32, 53, or 64 bit numbers, depending on what is being used. The integer_mod bounds are (correctly or incorrectly) separate from this. - Robert On Jun 21, 2007, at 6:41 PM, William Stein wrote: > Hi, > > Here's the patch I posted for the linear algebra problem. I think > the issue > is definitely subtler than Robert Bradshaw's patch suggests. See > below. > > -- William > > ---------- Forwarded message ---------- > From: William Stein <[EMAIL PROTECTED]> > Date: Jun 6, 2007 6:55 PM > Subject: Re: [sage-support] ring conversion error > To: [EMAIL PROTECTED] > > > On 6/6/07, Thea Gegenberg <[EMAIL PROTECTED]> wrote: >> If I am working with matrices over integers mod something then we I >> try to multiply a row by some number I get an error for moduli >> between >> 46341 and 18446744073709551614. >> >> Here is an example of what I am doing: >> sage: D=46341 >> sage: u=7 >> sage: R=Integers(D) >> sage: p=matrix(R,[[84, 97, 55, 58, 51]]) >> sage: R(u)*p.row(0) >> >> The error I get is "TypeError: Cannot convert >> sage.rings.integer_mod.IntegerMod_int64 to >> sage.rings.integer_mod.IntegerMod_int". > > (1) As a hack, you could make your matrix sparse, so a different > data type is used, and the error will go away: > p=matrix(R,[[84, 97, 55, 58, 51]], sparse=True) > This will -- of course -- be slower. > > (2) Or -- you could apply the attached patch with > hg_sage.import_patch('4878.patch') > > -- William > > > > -- > William Stein > Associate Professor of Mathematics > University of Washington > http://www.williamstein.org > > > > <4878.patch> --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---