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

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

[Octave-bug-tracker] [bug #65928] movfun dimension contstraints: shouldn


From: Dmitri A. Sergatskov
Subject: [Octave-bug-tracker] [bug #65928] movfun dimension contstraints: shouldn't error for dim > ndims(x), or wlen > size(x, dim), or wlen=1
Date: Sat, 29 Jun 2024 17:16:44 -0400 (EDT)

Follow-up Comment #1, bug #65928 (group octave):

I guess the tests need to be adjusted:

***** test <*65927>
 a = reshape (1:30, 5, 3, 2);
 b1 = cat (3, [1, 6, 11], [16, 21, 26]) + [0, 0.5, 1.5, 2.5, 3.5]';
 b2 = cat (3, [1:5]', [16:20]') + [0, 2.5, 7.5];
 b3 = cat (3, [1:5]', [8.5:1:12.5]') + [0, 5, 10];
 assert (movfun (@mean, a, 2), b1, eps);
 assert (movfun (@mean, a, 2, 'dim', 1), b1, eps);
 assert (movfun (@mean, a, 2, 'dim', 2), b2, eps);
 assert (movfun (@mean, a, 2, 'dim', 3), b3, eps);

 a2 = cat (4, a, a, a, a);
 assert (size (movfun (@mean, a2, 2)), [5, 3, 2, 4]);
 assert (size (movfun (@mean, a2, 2, 'dim', 1)), [5, 3, 2, 4])
 assert (size (movfun (@mean, a2, 2, 'dim', 2)), [5, 3, 2, 4]);
 assert (size (movfun (@mean, a2, 2, 'dim', 3)), [5, 3, 2, 4]);
 assert (size (movfun (@mean, a2, 2, 'dim', 4)), [5, 3, 2, 4]);
!!!!! regression: https://octave.org/testfailure/?65927
movfun: failed validation of 'dim'.  Checked with "@(d) isempty (d) ||
(isscalar (d) && isindex (d, ndims (x)))"


Dmitri.
-- 



    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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