> < ^ Date: Mon, 09 Oct 2000 18:15:12 +0200
> < ^ From: Dmitrii Pasechnik <d.pasechnik@twi.tudelft.nl >
< ^ Subject: Re: Compressed vectors/matrices are always 0.

Dear Forum,

Michael Weller writes:
> I need to do some finite field matrix computations over GF(43) of high
> enough dimensions s.t. the compressed storage technique is absolutely
> needed. Alas, whenever I ConvertToMatrixRep or even ConvertToVectorRep
> I end up with a zero matrix/vector. This is the case for all machines and
> fields I tried. Even for GF(2) like in the example below:
[...]
> gap> test := [1,0,1,0,1];
> [ 1, 0, 1, 0, 1 ]
> gap> MakeImmutable(test);
> gap> ConvertToVectorRep(test, 2);

If you check the documentation on ConvertToVectorRep you see that
the elements of test must lie in GF(2).

`ConvertToVectorRep( <list> , <field> )' converts <list> to an internal
vector representation appropriate for a vector over <field>. It is
forbidden to call this function unless all elements of <list> lie in
<field>.

thus, you should do 
gap> test :=Z(2)* [1,0,1,0,1];
[ Z(2)^0, 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0 ]

 gap> ConvertToVectorRep(test, 2);
2
gap> Print(test);
[ Z(2)^0, 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0 ]gap>
gap> MakeImmutable(test);
gap> test;
<an immutable GF2 vector of length 5>
gap> Print(test);
[ Z(2)^0, 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0 ]gap>

I changed the order of calles to CovertToVectorRep and MakeImmutable,
as I'd be rather surprised that one can actually change an immutable object
(by calling ConvertToVectorRep)

HTH,
Dmitrii


> < [top]