[Matrix-SIG] broadcast rules

Warren B. Focke warren@pfiesteria.gsfc.nasa.gov
Wed, 18 Nov 1998 17:02:45 -0500 (EST)


Is broadcasting expected to work differently for arithmetic operations and
assignment? 

-pfiesteria:~> python
-Python 1.5.1 (#1, Aug  8 1998, 13:33:40)  [GCC egcs-2.90.29 980515 (egc on linux2
-Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
->>> import Numeric
->>> a=Numeric.ones((4,2))
->>> b=Numeric.ones((4,1))
->>> a[...]+b
-array([[2, 2],
-       [2, 2],
-       [2, 2],
-       [2, 2]])
->>> a[...]=b
-Traceback (innermost last):
-  File "<stdin>", line 1, in ?
-ValueError: matrices are not aligned for copy


Happens with 1.5/1.0 on linux/pentium, alpha/osf, and sparc10/4.1.4; and
1.5.1/1.5 on linux/pII.


Warren Focke