MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Precedence

  • To: mathgroup at
  • Subject: [mg60284] Re: Precedence
  • From: "Carl K. Woll" <carlw at>
  • Date: Sat, 10 Sep 2005 06:46:35 -0400 (EDT)
  • Organization: University of Washington
  • References: <dfrgpu$fr6$>
  • Sender: owner-wri-mathgroup at

"Xerxes" <Xerxes314 at> wrote in message 
news:dfrgpu$fr6$1 at
> Hi all,
> I've been writing a package using Mathematica to do lattice
> perturbation theory. As a part of my package, I'd like to
> define my own matrix multiplication, which I call dotm. Since
> CenterDot looks pretty and has no previous assignment, I've
> used it as both the input and output format of dotm. However,
> I run into problems when I try to type things like
> Y[x].g A[x].Y[x+a]
> where the . should be imagined to be CenterDot. Because the
> precedence of the . is higher than the precedence of the
> multiplication, this gives (Y.g)(A.Y) instead of Y.(gA).Y.

The way to change the precedences is to edit the file 
in the directory SystemFiles/FrontEnd/TextResources. Open the file with a 
text editor, look for CenterDot. One of the entries for CenterDot (in 5.2) 
is 530, and the same entry for Times is 520. These numbers are the 
precedences of the operators. Change 530 to something less than 520, such as 
510. You may need to reset your preferences. In Windows this is done by 
holding down Ctrl and Shift when starting Mathematica. These precedence 
numbers change with different versions so your version may be different.

> I know I can attach a TagBox to the CenterDot to force it to
> have lower precedence, but that ruins the convenience of typing
> esc-.-esc to get the dot. Is there some other way to teach
> Mathematica to use a lower precedence?
> Xerxes

Carl Woll
Wolfram Research 

  • Prev by Date: Re: Precedence
  • Next by Date: Re: PolynomialGCD
  • Previous by thread: Re: Precedence
  • Next by thread: Re: Precedence