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.
Array[i] := etoArray[i] := new NullMat(a,b)because setting it toeeach time is just pointing it to the same memory location each and every time. – JMoravitz Aug 15 '19 at 19:08eis a pointer to the same object. You could useStructuralCopy(e)to get an equal, but disjoint object. – ahulpke Aug 15 '19 at 20:13