GAP — null multidimensional array

52 Views Asked by At

I need to create an $n\times a \times b$ array in GAP. How do I do that fast?

I tried putting

e := NullMat(a,b);
Array := [];
for i in [1..n] do
Array[i] := e;
od;

However, then when I try to change a single entry, GAP changes it in every copy of $e$. And this is far from ideal.

1

There are 1 best solutions below

0
On BEST ANSWER

Got it! The following construction works alright. However, I don't know how to do that in an arbitrary dimension.

Array := [];
for i in [1..n] do
    Array[i] := NullMat(a,b);
od;