2011/12/28 Jordi Gutiérrez Hermoso <jord...@octave.org> > On 28 December 2011 13:41, Ralf Gommers <ralf.gomm...@googlemail.com> > wrote: > > > > > > 2011/12/28 Jordi Gutiérrez Hermoso <jord...@octave.org> > >> > >> Just FYI, the next stable release of Octave (3.6) will have > >> broadcasting. I used Numpy as an inspiration. > >> > >> Here is the WIP manual for it: > >> > >> > >> > http://jordi.platinum.linux.pl/octave.html/Broadcasting.html#Broadcasting > > > > Is this a departure of maintaining full compatibility with Matlab? > > No, Matlab code will still work in Octave, except in very rare cases, > but it's a matter of flipping a switch to make those weird cases work > as well. > > Octave isn't a Matlab clone. The goal is to be source compatible to > Matlab: code that runs in Matlab should run in Octave, but we don't > try to limit ourselves to whatever Matlab does, nor do we copy every > bug unless there's a very good reason to copy its bugs. > > I think I may be missing a few broadcasting behaviours regarding > assignment. Is something like that possible, to broadcast a vector > across a matrix during assignment? > > - Jordi G. H. >
Numpy does it: In [12]: x = numpy.zeros((3, 3)) In [15]: x[:] = numpy.arange(3) In [16]: x Out[16]: array([[ 0., 1., 2.], [ 0., 1., 2.], [ 0., 1., 2.]]) -=- Olivier
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion