On Thu, Dec 15, 2011 at 4:56 PM, John W. Eaton
<address@hidden> wrote:
On 15-Dec-2011, Judd Storrs wrote:
| If you sat down to describe this to anyone you would never use the
| word "broadcast". It's quite a boring and confusing phrase for an
| exciting feature.
I have no problem with the term. It sure beats bsxfun.
| "Broadcast" to me (and probably anyone) conjures a sense of
| communication or signaling not duplication. It's a really unexpected
| use. I can't imagine telling anyone about this feature and using the
| word "broadcast" without also having to redefine their understanding
| of the word "broadcast". This should be a key feature to lord over
| Matlab users, but this phrasing is just suicide.
That seems a bit dramatic.
How about the following as a NEWS file entry?
Many of Octave's binary operators (.*, .^, +, -, ...) now perform
automatic broadcasting for array operations that allows you to use
operator notation instead of calling bsxfun or expanding arrays (and
unnecessarily wasting memory) with repmat or similar idioms. For
example, to scale the columns of a matrix by the elements of a row
vector, you may now write
r .* M
In this _expression_, the number of elements of r must match the
number of columns of M. The following operators are affected:
plus ldivide rem eq gt xor
minus power mod ne ge
times max atan2 lt and
rdivide min hypot le or
+ .* &
- ./ |
.+ .\
.- .^
+= .*= &=
-= ./= |=
.+= .\=
.-= .^=
See the new "Broadcasting Operations" chapter in the manual for more
details.
I don't think there's any need to mention numpy in the news entry.
Now we just need the new chapter for the manual that describes this
new feature in more detail.
jwe
This is a great new feature, thanks to those of you who have been working on it. Broadcasting seems like a reasonable name to me. Incidentally, I'm pretty sure that the matrix programming language Gauss had this feature many years ago, numpy didn't invent it.