[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63277] isfinite returns full array in Matlab
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #63277] isfinite returns full array in Matlab for sparse input |
Date: |
Thu, 27 Oct 2022 18:00:02 -0400 (EDT) |
Follow-up Comment #4, bug #63277 (project octave):
I used grep to find a list of isfinite instances where the output is negated
(and hence could be large if the input were sparse). The instances are
+matlab/+lang/MemoizedFunction.m:134: || ! isfinite (val))
+matlab/+lang/MemoizedFunction.m:140: if (! isscalar (val) || !
isnumeric (val) || ! isfinite (val) ...
general/int2str.m:80: nan_inf = ! isfinite (n(:));
general/quadgk.m:374: if (any (! isfinite (q_subs)))
general/quadgk.m:450: if (any (! isfinite (q_subs)(:)))
general/quadl.m:112: elseif (any (! isfinite (q(:))))
general/quadv.m:154: elseif (any (! isfinite (q(:))))
linear-algebra/cond.m:67: elseif (any (! isfinite (A(:))))
miscellaneous/mustBeInteger.m:53: elseif (any (! isfinite (x)))
optimization/glpk.m:526: if (any (! isfinite (b(:))))
optimization/glpk.m:593: || any (! isfinite (sense)))
polynomial/roots.m:89: elseif (any (! isfinite (c)))
set/uniquetol.m:207: eq_rows(i,1) = eq_rows(i,1) || any (! isfinite
(Arow_i), 2);
specfun/primes.m:55: if (! isfinite (n) && n != -Inf)
testfun/assert.m:351: | ! isfinite (A_null_real) & !
isfinite (B_null_real);
testfun/assert.m:362: | ! isfinite (A_null_imag) & !
isfinite (B_null_imag);
Most of these can be ignored because the input can be guaranteed to be small.
I changed cond.m and mustBeInteger.m in this changeset:
http://hg.savannah.gnu.org/hgweb/octave/rev/303bbdc3c536.
The remaining question is whether to change the two instances in assert.m It
will require introducing two new temporary variables, making their calculation
dependent on whether the input is full or sparse, and then clearing those
variables at the end of the block doing this calculation.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63277>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/