Strange, Gmail has cut my example.

** [1 2]**
**A = [3 4]**

** [5 6]**
**B = [7 8]**

** [a d]****C = [b c]**

**(A*B)@C**

**=****[5 12] [a d]**
**[21 32] @ [b c]****=**
**[5a+12b 5d+12c ]****[21a+32b 21d+32c]**

**A*(B@C)****=**
**[1 2] [5a+6b 5d+6c]**
**[3 4] * [7a+8b 7d+8c]****=**
**[5a+6b 10d+12c]****[21a+24b 28d+32c]**

Here it is normally.

2014-03-18 16:29 GMT+01:00 Robert Kern <robert.kern@gmail.com>:

On Tue, Mar 18, 2014 at 3:22 PM, Christophe Bal <projetmbc@gmail.com> wrote:What example above?

> About weak-left. You need to define a priority of @ the matrix product

> regarding to * the elementwise product because (A*B)@C <> A*(B@C) : see the

> example above. I say that also from a mathematical point of view.

This seems to argue against what you just said.

> Using mathematical like notations, Matrix1 * Matrix2 * 3 can be written

> because (Matrix1 * Matrix2) * 3 = Matrix1 * (Matrix2 * 3).

But this is true as well:

> That's why I think that the weak-left is the better choice.

3 * Matrix1 * Matrix2 = (3 * Matrix1) * Matrix2 = 3 * (Matrix1 * Matrix2)

Does that expression argue for tight-left?

--

Robert Kern

_______________________________________________

NumPy-Discussion mailing list

NumPy-Discussion@scipy.org

http://mail.scipy.org/mailman/listinfo/numpy-discussion