octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #38466] incorrect broadcasting for 'a .*= b' w


From: ederag
Subject: [Octave-bug-tracker] [bug #38466] incorrect broadcasting for 'a .*= b' when b has fewer dimensions than a
Date: Fri, 09 Oct 2015 19:21:05 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0

Follow-up Comment #6, bug #38466 (project octave):

In 4.0.0 also the problem is still there:

a = ones(2, 2, 2);
b = ones(2, 1); # compatible with a, and smaller
a .*= b
yields an error

while 
a = a .* b
runs fine

If a .*= b were just syntactic sugar for a = a .* b,
than there should not be any error, right ?

Please note that in this example a is larger than b.
in this case the operation could be done in-place, for better performance. The
size of a is not changed at all.

Of course, for b .*= a (where b is smaller than a .* b), the operation could
not be done in-place. In this case, b should just receive a .* b.

As a side note
a(:, :, :) .*= b
works, but I suspect there are no optimizations in this case (with respect to
a = a .* b) ?

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38466>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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