> < ^ From:

^ Subject:

Dear Erik, Jasper & Reinald,

you wrote:

We want to use blists as a representation for binary codewords

because we hope it will be much faster than to use elements of

GF(2).

yes, at the moment this is most certainly true.

But we could not find a function for XOR(blist1, blist2) or

for NOT(blist1) which would make the functions we need (like our

function "distance") much faster. We now useBlistList(list1,[false]) instead of Not(blist1)but it is too slow. Are you implementing those functions in the

near future?

Have you tried to use the functions 'SubtractBlist' or 'DifferenceBlist'

(the latter is essentially "SubtractBlist( Copy(blist1), blist2 )")? The

function 'DifferenceBlist( b1, b2 )' will return a boolean list <d> such

that "d[i] = b1[i] and not b2[i]". If you keep a copy of an all true boolean

list, then "Not(b1) = DifferenceBlist( all_true, b1 )" and

gap> XorBlist := function( b1, b2 )

return UnionBlist(DifferenceBlist(b1,b2), DifferenceBlist(b2,b1));

end;

# or to avoid one copy and two functions calls

gap> XorBlist := function( b1, b2 )

local r;r := Copy(b1); SubtractBlist( r, b2 ); b2 := Copy(b2); SubtractBlist( b2, b1 ); UniteBlist( r, b2 ); return r; end; gap> b1 := [ true, true, false, false ]; [ true, true, false, false ] gap> b2 := [ true, false, true, false ]; [ true, false, true, false ] gap> XorBlist( b1, b2 ); [ false, true, true, false ]

I admit that this will be a bit slower than a genuine 'XorBlist' but

it might be fast enough for your purpose. Please keep us informed.

best wishes

Frank

> < [top]