       Re: Stop mathematica reordering expression during matrix multiply

• To: mathgroup at smc.vnet.net
• Subject: [mg109408] Re: Stop mathematica reordering expression during matrix multiply
• From: Simon <simonjtyler at gmail.com>
• Date: Sun, 25 Apr 2010 06:26:18 -0400 (EDT)
• References: <hqu8cj\$rq1\$1@smc.vnet.net>

```Hi Robert,

I think that what you want to do can be found on the research page of
George Stacey Staples:
http://www.siue.edu/~sstaple/index_files/research.htm

Simon

On Apr 24, 3:59 pm, Robert Wright <mathematicaus... at yahoo.com> wrote:
> I am using a Graph Theory algorithm which requires that I multiply an edg=
e-weighted adjacency matrix with symbolic parts. In my problem, the order o=
f the symbols corresponds to the edges that make up a path - for example, x=
2 x1 x7 would indicate that the path progresses from x2 to x1 then x7. The =
snag comes when Mathematica reorders the symbols in each expression appeari=
ng in the matrix result from multiplying Ci x Cj - is there a way of stoppi=
ng this from happening?
>
> Here is some code that illustrates the problem:
>
> C1 = {{0, x1, 0, 0}, {x2, 0, x3, 0}, {x4, 0, 0, x5}, {x6, 0, x7, 0}};
> C2 = C1.C1;
> MatrixForm@C2
>
> The MatrixForm output shows how Mathematica has sequenced the symbols in =
'ascending' order. In my case, I want to preserve the order of the symbols =
in the calculated expression: so, for example, row 4 of C1 times column 2 o=
f C1 should give x4 x1 and not x1 x4. How do I stop Mathematicafrom reorder=
ing the resulting expression?

```

• Prev by Date: Re: Function to detect presence of a variable in
• Next by Date: Re: Function to detect presence of a variable in
• Previous by thread: Stop mathematica reordering expression during matrix multiply
• Next by thread: Kernel crash, version 7.0, windows XP, when using slider in Manipulate with Dynamics plot on control area