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

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

[Octave-bug-tracker] [bug #60539] Slow performance of betaincinv.m


From: Rik
Subject: [Octave-bug-tracker] [bug #60539] Slow performance of betaincinv.m
Date: Fri, 28 May 2021 18:33:49 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36

Follow-up Comment #19, bug #60539 (project octave):

Tackling the second question first.  The singleton expansion which is
implemented by the common_size() function is different and distinct from
"broadcasting".  It's helpful to look in the Octave manual at Section 19.2
Broadcasting which also documents that broadcasting is *only* implemented for
a select number of operations.  The full list is


plus
minus
times
rdivide
ldivide
power
lt
le
eq
gt
ge
ne
and
or
atan2
hypot
max
min
mod
rem
xor


Matlab actually followed after Octave and Python in implementing this feature,
and they too only do it for a select few functions.  The list is available in
the documentation of bsxfun at
https://www.mathworks.com/help/matlab/ref/bsxfun.html.

It's unlikely that Octave would choose to make all functions broadcast, as
that would be both a big conceptual change and also a large divergence from
Matlab compatibility.

For reference, the following code emits an error in Matlab because the input
sizes don't match.


x=0.5;
a=[1 1];
b=[1;1];
betainc (x, a, b)


but


betainc (x, 1, b)


does work and returns a 2-element column vector because variable 'b' is a
column vector.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60539>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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