ok, thanks! On Mon, Nov 17, 2008 at 2:39 PM, David Joyner <[EMAIL PROTECTED]> wrote: > > On Mon, Nov 17, 2008 at 3:24 PM, Martin Mereb <[EMAIL PROTECTED]> wrote: >> >> I see I expressed myself wrong >> (I meant the problem was in the "for" line) >> so what's going on is that gap is attempting to built first the whole >> list and that is taking way too much time (right?) >> are there any iterator that avoids that amount of memory and take the >> elements "on the fly", like xrange? >> Because I don't wanna print all of the matrices, I just wanted to >> iterate among them and compute one counterexample and then break the >> loop, and I just found out the problem was when the iteration begins. > > > GAP's Filtered command is relatively fast at doing that. > http://www.gap-system.org/Manuals/doc/htm/ref/CHAP021.htm#SSEC020.18 > > >> >> On Mon, Nov 17, 2008 at 12:31 PM, Justin C. Walker <[EMAIL PROTECTED]> wrote: >>> >>> >>> On Nov 17, 2008, at 9:34 AM, Martin Mereb wrote: >>> >>>> >>>> I'm trying to run the following: >>>> >>>> sage: n=3; q=7; G=SL(n,q) >>>> sage: for a in G: >>>> ....: print a >>>> ....: >>>> >>>> it just got stuck there, nothing shows up (for a looong while) >>>> this is Sage version 3.1.1 >>>> >>>> and if I try the same with q=4 it works (but it takes some time to >>>> start) >>>> any ideas? >>> >>> There's a Gap in your thinking. Or, at least, in your processing :-} >>> >>> In this case (SL(n,q)), we ask Gap to produce the results. In both >>> cases (q=4,7), Gap is working pretty hard to come up with the >>> elements in the group (it does have 5.6 million elements, for q=7; >>> for q=4, it's ~60K). In any case, the time is being spent in Gap, >>> and it has nothing to do with 'for'. >>> >>> If you start Gap (e.g., "sage -gap" in a shell window), and compute >>> either Elements(SL(3,7)) or AsList(SL(3,7)) (the latter presumably >>> being faster, but I didn't have the patience to wait :-}), you will >>> see what I mean. >>> >>> HTH >>> >>> Justin >>> >>> -- >>> Justin C. Walker, Curmudgeon-At-Large >>> Institute for the Absorption of Federal Funds >>> -------- >>> Men are from Earth. >>> Women are from Earth. >>> Deal with it. >>> -------- >>> >>> >>> >>> >>> > >>> >> >> > >> > > > >
--~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
