IIUC Maxima arrays are hashes, so the order is not as firm as with matrices. That aside it seems it should be possible with some knowledge of how the array was generated and genmatrix
, see the fifth faq entry.
So if the array is generated like this:
(%i1) for i thru 4 do for j thru 4 do A[i,j]: i+j$
We have:
(%i2) listarray(A);
(%o2) [2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8]
(%i3) arrayinfo(A);
(%o3) [hashed, 2, [1, 1], [1, 2], [1, 3], [1, 4], [2, 1], [2, 2], [2, 3], [2, 4], [3, 1], [3, 2], [3, 3], [3, 4], [4, 1], [4, 2], [4, 3], [4, 4]]
A
can be converted to a 4x4 matrix like this:
(%i4) genmatrix(A,4,4);
[ 2 3 4 5 ]
[ ]
[ 3 4 5 6 ]
(%o4) [ ]
[ 4 5 6 7 ]
[ ]
[ 5 6 7 8 ]