Canonical order...

• To: mathgroup at smc.vnet.net
• Subject: [mg54989] Canonical order...
• From: Josef Karthauser <joe at tao.org.uk>
• Date: Wed, 9 Mar 2005 06:34:16 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```I'm trying to adjust what Mathematica thinks is canonical order for
a particular function F[], so that orderless functions such as
Times[F[c], F[a], F[b]] automatically gets ordered according to my
specified sort ordering function on F.

I thought that I could do it by tweaking with Order, i.e.

Order[F[a_], F[b_]] := -Order[a,b]

for instance.

I was hoping then that,

Times[F[a],F[b]]

would then become the canonical,

Times[F[b],F[a]],

but this doesn't happen:

: Order[F[a], F[b]]
= -1

: Times[F[b], F[a]]
= F[a] F[b]

: % // FullForm
= Times[F[a], F[b]]

Ok, so it looks like Sort, isn't paying attention to Order[].  Should
it? How do I go about changing the default sort order for a particular
function?

: Sort[{F[a], F[b]}]
= {F[a], F[b]}

Joe

p.s. I've asked for a lot of help recently, but not given much in
return.  Many thanks to all of you who are helping me out with this
learning curve! :)  You're all stars!
--
Josef Karthauser (joe at tao.org.uk)	       http://www.josef-k.net/
FreeBSD (cvs meister, admin and hacker)     http://www.uk.FreeBSD.org/
Physics Particle Theory (student)   http://www.pact.cpes.sussex.ac.uk/
================ An eclectic mix of fact and theory. =================

```

• Prev by Date: Re: BS PDE
• Next by Date: Re: BS PDE
• Previous by thread: Re: findfit or solve?
• Next by thread: Re: Canonical order...