Question: How to display the results faster after a Grip Map run?

Hi,


I was applying the Grip Map to the procedure LArip. It apparently finished in less than 5 seconds. But when I wanted to display the results as an Array, this step required minutes. How can this time be reduced? Here is a piece of the code:

n := 8;
r := 2^n;
M := Vector(r, randperm(r) + [-seq(1, i = 1 .. r)], datatype = integer[4]);

LArip := proc(k::integer, r::integer, M::Vector(datatype = integer[4]))
local N, j, t, i, A;
N := Vector(r, 0); A := Vector(r, 0);
i := k - 1;
for j from 0 to r - 1 do
for t from 0 to r - 1 do
N[t + 1] := Occurrences(1, Split(Xor(And(t, i), And(M[t + 1], j)))) mod 2;
end do;
A[j + 1] := Occurrences(0, convert(N[], list));
end do;
return convert(A, list);
end proc;

infolevel[Grid:-Map] := 3;
rt := time[real]();
Bb := Grid:-Map(k -> LArip(k, r, M), [$ (1 .. r)]);
GridMapTime := time[real]() - rt;
 

The worksheet is here:

Magma_GridMap.mw

Thank you for your help.

Please Wait...