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

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

[Octave-bug-tracker] [bug #63802] movfun always returns class="double"


From: Rik
Subject: [Octave-bug-tracker] [bug #63802] movfun always returns class="double"
Date: Mon, 27 Feb 2023 13:01:55 -0500 (EST)

Follow-up Comment #8, bug #63802 (project octave):

I agree that movfun is so general that it is hard to imagine all the
permutations in which it might be called.  In addition, a function maps an
input range to an output domain.  There is no guarantee that 0 (of any class)
is in the input range of the function so f(0) may not even be valid. 
Likewise, many functions, particularly user functions, often have poor input
handling for empty matrices.  They were written with internal assumptions that
some data would be present so one can't call f([]) which would avoid the
function range question that I just raised.

Given that we're going to have to make some assumptions, it feels like
arbitrarily assigning the output to be of the default class for all of Octave
("double") is just as good or better as assuming that the output class will be
the same as the input class.

You're right that we can use the shortcut code for all empty matrices, not
just when requested to calculate along an empty dimension.  I checked in a
changeset for that.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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