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: Michael Leitner
Subject: [Octave-bug-tracker] [bug #60539] Slow performance of betaincinv.m
Date: Fri, 28 May 2021 11:56:10 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

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

To my point about common_size and singleton expansion in comment 6 that you,
Rik, answered in comment 7: I think you are not right. Consider the
following:


x=0.5;
a=[1 1];
b=[1;1];


I can compute x+a+b without problems, and it gives me a 2x2-matrix (and that's
what I understand as singleton expansion -- you can do element-wise arithmetic
operations with operands that for a given dimension have either all the same
size or some of them have size one, in which case they will be expanded in
this dimension). However, betaincinv(x,a,b) refuses. Note that it is the same
for betainc. And this is due to the use of common_size().

According to its documentation, common_size gives ERR=1 "if the inputs cannot
be brought to a common size". However, in the simplest example common_size([1
1],[1;1]) I would say they can -- it seems common_size really expands only
scalar arguments, like another sentence in its documentation implies. But this
is different from singleton expansion as implemented in the interpreter, which
acts on a per-dimension basis.

So what is that, a documentation bug of common_size or rather an
implementation bug? How it is used in betainc and betaincinv, it looks like an
implementation bug, as it could expand a and b without a problem. I cannot
judge whether there are instances in the code where it is used and it is
really necessary that expansion happens only for scalar arguments.

    _______________________________________________________

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]