I have been using Maxima for manipulations of block-matrices and
block-vectors.
I have encountered a problem with the definition of columnvector
defined in eigeni.mac:
columnvector(x):=transpose(matrix(x))$
This definition is ok for vectors containing scalar elements, but
appears to be wrong for vectors whose components are other vectors and
matrix_element_transpose = transpose since transpose will be applied
to each element.
For example, I wish to create a column vector whose elements are
the (column) vectors v1 and v2:
(%i30 matrix_element_transpose:transpose$
(%i4) columnvector([v1,v2]);
[ transpose(v1) ]
(%o4) [ ]
[ transpose(v2) ]
What I expected to see was:
[ v1 ]
(%o4) [ ]
[ v2 ]
The following definition appears to do what I expected:
colvect(l):=block([mat,row,elem],
mat: zeromatrix(length(l),1),
row:1,
for elem in l do (
setelmx(elem, row, 1, mat),
row:row+1),
mat
)$
Perhaps I am making an incorrect assumption about columnvector.
In the case where the list of elements contains vectors are they
expected to be column vectors or row vectors. The definition
of columnvector is correct if they are row vectors.