Hi,
Many thanks for your reply!
> I don't know what exactly you are doing to make
> an extra level of lists, but if you want to extract
> the nth row of a matrix, try part(mat,n). I suppose
> a column could be obtained by transposing first.
As an example, take a:transpose([1,2,3]) which is a column vector.
When you say a[1], Maxima returns [1] and not 1, which is more desirable in
some situations (eg., when you compute x+dx, where x and dx are two
vectors). Effectively, a seems to be [[1],[2],[3]] rather than the [1,2,3]
I expected (with everything transposed to make column vectors of course). I
can certainly apply part(a,1) repeatedly, but it would be nice to not have
to do this.
> Is it perhaps the case that a column vector in
> macsyma is not what you think , but a 2-d matrix
> one of whose dimensions is 1?
I certainly appreciate that, but again, if a vector is updated in a
loop, you can end up with several dimensions. Generally, I've found that
Maxima crashes before proceeding too far along these lines!
Dave Holmgren
> David Holmgren wrote:
> >
> > Hi,
> >
> > I'm working on some routines for optimization using Maxima (e.g,
> > second-order Newton method, Levenberg-Marquardt), and I've run into a
> > problem with routines related to matrix manipulation. For example, when
> one
> > solves a matrix equation A.x = b by using x:invert(A).b, x is a list of
> > lists. So, when this is done in an iterative loop, the problem
> compounds
> > itself so that on the next iteration one gets a list of list of lists,
> etc.
> > Another example is when one forms a row vector by doing something like
> > v:transpose([1,2,3]) - this also gives a list of lists. Is there any
> way of
> > controlling or avoiding this behavior in Maxima? I am not yet
> sufficiently
> > familiar with Maxima programming to see a way out of this.
> >
> > Many thanks for any advice, etc., on this.
> >
> > Sincerely,
> >
> > David Holmgren
> >
> > Dr. David E. Holmgren,
> > Imaging Scientitst,
> > SMART Technologies, Inc.
> > Calgary, AB, Canada
> > http://www.smarttech.com
> > [403]-235-1452, ext. 251
> > DavidHolmgren@smarttech.com
> >
> > _______________________________________________
> > Maxima mailing list
> > Maxima@www.math.utexas.edu
> > http://www.math.utexas.edu/mailman/listinfo/maxima