[GAP Forum] Running through subspaces over finite field

Arturo Magidin magidin at member.ams.org
Tue Jun 12 16:09:20 BST 2007


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



More information about the Forum mailing list