# [Maxima] Ordering of vector variables?

Richard Fateman fateman at cs.berkeley.edu
Mon Mar 24 18:01:30 CDT 2008

```Re-examining 'great' and friends should be done with extreme caution.
powerdisp:true is intended for power-series.   If you want to display
polynomials in the reverse order from the usual in Maxima,  (as it is in
Mathematica), then powerdisp is the way to do it.

I believe that the simplifier spends the vast majority of its time in
'great' etc.  Code to make this stuff exponentially faster, at least
with lisps that have good hash coding, has been demonstrated (by me).

Changing the actual ordering relations (as opposed to making them faster to
determine) could have very subtle and wide-ranging effects.

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Raymond
> Toy (RT/EUS)
> Sent: Monday, March 24, 2008 9:20 AM
> To: Robert Dodier
> Cc: Maxima List
> Subject: Re: [Maxima] Ordering of vector variables?
>
> Robert Dodier wrote:
> > On Mon, Mar 24, 2008 at 9:45 AM, Raymond Toy (RT/EUS)
> > <raymond.toy at ericsson.com> wrote:
> >
> >> While playing with donlp2, I noticed that maxima orders
> vector variables
> >>  in "reverse" order.   For example,
> >>
> >>  sum(x[k],k,1,5) -> x[5]+x[4]+x[3]+x[2]+x[1].
> >>
> >>  While I usually just accept whatever order maxima wants to display
> >>  variables, this particular example seems wrong.  There's a natural
> >>  ordering and it's by the index of the variable.
> >>
> >>  Any reason why it should be in reverse order?  Any objections to
> >>  changing it for this case?  (I don't know if that's
> really possible or
> >>  not.  I haven't looked.)
> >
> > The terms x[1], x[2], ... are stored in order of increasing index.
> > Whether they are displayed that way or reversed is controlled
> > by the global variable powerdisp. When powerdisp=true the terms
> > are displayed in order of increasing index.
>
> So many globals!  powerdisp certainly does what I want, but it also
> changes how polynomials are displayed.  I always want vectors
> displayed
> in increasing order of index, but polynomials are different.
>
> But this works for me.  No need to change the default.
>
> >
> > I'm not opposed to changing the default value of powerdisp to true.
> >
> > Aside from changing powerdisp, we could also change GREAT
> > (the function which implements Maxima's idea of canonical
> > ordering). Changing GREAT could have rippling effects, though.
>
> If I were to make such a change, I would have it only affect
> arrays, and
> maybe only 1D arrays.  That should limit the effects.
>
> But powerdisp suits me for now.
>
> Thanks,
>
> Ray
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
```