[Maxima] proposal about vectors
Viktor T. Toth
vttoth at vttoth.com
Wed Nov 19 06:24:29 CST 2008
Interesting. I think that the listarith:false behavior is simply wrong, and
I think I know why it happens... trouble is, it may be harder to fix than
the original issue, that is, extending listarith to do its stuff for
matrices, too.
Haven't looked at the code yet, but it seems pretty clear to me what
happens: when we suppress list-specific evaluation with listarith:false, the
general simplifier takes over. The simplifier doesn't care that [1,2] is a
list; all it knows are generic rules, such as 0*anything = 0 or
anything-anything = 0. So, we have to make sure that these generic
simplifications are suppressed for lists; or perhaps, we have to make sure
that they never get a chance, by not suppressing list-specific
simplification in cases such as 0*[1,2] even when listarith is false.
I'll have to think about this.
Viktor
-----Original Message-----
From: van Nek [mailto:van.nek at arcor.de]
Sent: Wednesday, November 19, 2008 2:20 AM
To: Viktor T. Toth
Cc: Maxima at math.utexas.edu
Subject: RE: [Maxima] proposal about vectors
Viktor,
I have noticed that with listarith:false we have the following
(%i1) 0*[1,2];
(%o1) [0, 0]
(%i2) [1,2]-[1,2];
(%o2) [0, 0]
(%i3) listarith:false$
(%i4) 0*[1,2];
(%o4) 0
(%i5) [1,2]-[1,2];
(%o5) 0
So if we want to use listarith:false for vectors, we must allow 0 * vector
to be the exception
from the general rule.
So if listarith=true or factor=0 then factor*[a,b] ---> [0,0].
Matrices accordingly.
What do you think? Perhaps on your work on listarith you step over this
point.
Volker
More information about the Maxima
mailing list