octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing broadcasting from Octave


From: John W. Eaton
Subject: Re: Removing broadcasting from Octave
Date: Wed, 14 Dec 2011 12:56:54 -0500

On 14-Dec-2011, Jordi Gutiérrez Hermoso wrote:

| > But then, what is expected for ...
| >
| >        rand (4,4) * (1:4)
| >
| >        rand (4,4) .* (1:4)
| >
| >        rand (4,4) / (1:4)
| >
| >        rand (4,4) ./ (1:4)
| >
| > I was thinking that ".<op>" would imply a repmat(), while "op" would
| > stick to standard matrix operations.
| 
| Right, if we keep broadcasting and decide to distinguish + and .+, I
| agree that the latter should broadcast, for consistency with * and .*
| 
| Actually, I am very much in favour of this, and I suspect it would fix
| a good deal of broken expectations. From the code I've read, most
| people do not do .+ except when cargo-culting .* and ./ with the
| mistaken belief that "all elementwise operations need a dot in front
| of them". Thus, +, -, *, and / would all consistently perform matrix
| operations without broadcasting.

And all .+, .-, etc., operations would be overloaded to do either
element-wise or broadcasting ops?

I don't remember what I suggested earlier, but looking at it now, this
is the opposite of what I thought we were doing.  So, +1 for the
confusion factor.c

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]