# [Maxima] simplified vector display output

Stavros Macrakis macrakis at alum.mit.edu
Wed Jan 4 11:38:41 CST 2012

```How about something like this:

(%i1) ex;
(%o1) [x^2-1,x^2-x,x^2-2*x+1,x^4-x^3-x+1]
(%i2) vfactor(v):=block([g:lreduce('gcd,v),listarith:false],g*map(lambda([q],factor(q/g)),v))\$
(%i3) vfactor(ex);
(%o3) (x-1)*[x+1,x,x-1,(x-1)*(x^2+x+1)]

Note the listarith trick -- the expression a*[b,c] is simplified with
listarith:false, so does not expand to [a*b,a*c] even when it is returned
from vfactor.  But if that expression is resimplified later, it will expand
out.  To avoid that, you could use "box" if necessary.

-s

On Tue, Jan 3, 2012 at 13:07, Burgess, Don <deburgess at asbury.edu> wrote:

>  Can Maxima recognize a known vector in a vector expression and give a
> simplified display output in terms of the Name of the known vector?
>
> So, for example, in the Maxima Session represented in the attached image,
> I would like Maxima to recognize "F.v1" as a scalar multiplied by a known
> vector " v1" and to display the result as "(2*alpha +1)*v1""
>
> Thank you very much for your help,
> don burgess
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20120104/41cfd678/attachment.html>
```