Dear Arturo,
to your last question, whether the order of elements of collections of
different calls to Iterator are fixed:
"If this is a collection C but not a list then iter iterates over the
elements of C in an unspecified order, which may change for repeated calls
of Iterator." (Reference Manual...Iterators)
So a fixed order is not guaranted by description of Iterator.
All the best, Rudolf
----- Original Message -----
From: "Arturo Magidin" <[EMAIL PROTECTED]>
To: "GAP Forum" <[EMAIL PROTECTED]>
Sent: Tuesday, June 12, 2007 5:09 PM
Subject: Re: [GAP Forum] Running through subspaces over finite field
On Mon, 11 Jun 2007, Rudolf Zlabinger wrote:
Dear Arturo Magidin,
if I understood right, you want to handle a collection:
gap> v:=GF(3)^10;
( GF(3)^10 )
gap> subspaces:=Subspaces(v,8);
Subspaces( ( GF(3)^10 ), 8 )
gap> IsCollection(subspaces);
true
gap>
For collections that are not lists, the default method is IteratorList(
Enumerator( C ) ). (Reference Manual.... Iterators)
Normally you would use enum:=Enumerator(subspaces), and then set
enum[xxx] to your desired element, but Enumerator(subspaces) runs out of
time and out of storage. Whereas you can process an Enumerator in the
same way as a list, an Iterator only is usable step by step, therefore
the definition of an Iterator is unsignificant to time and storage
independent from the magnitude of the collection.
The problem now is, that Enumerator doesnt run for the magnitude of your
collection, and an Iterator cannot be preset to a predefined element.
I was afraid of that.
The best I see, is, that an Iterator remembers the last element called by
NextIterator, so you can remember different states by different
variables, you have to use ShallowCopy to get a different Object::
That's fine. I don't really need to "remember" more than one object at a
time, so that is not really a problem.
On a related topic, then. Is the order in which the subspaces iterate
fixed, or can it change with different calls of an iterator for
Subspaces(V,k)?
If it is fixed, could someone point me in the direction of the algorithm
used to iterate through them?
Thanks,
Arturo
_______________________________________________
Forum mailing list
[email protected]
http://mail.gap-system.org/mailman/listinfo/forum
_______________________________________________
Forum mailing list
[email protected]
http://mail.gap-system.org/mailman/listinfo/forum