[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65221] movfun: create inputParser only once.
From: |
Nicholas Jankowski |
Subject: |
[Octave-bug-tracker] [bug #65221] movfun: create inputParser only once. |
Date: |
Sun, 30 Jun 2024 21:58:59 -0400 (EDT) |
Update of bug #65221 (group octave):
Status: Fixed => In Progress
Open/Closed: Closed => Open
_______________________________________________________
Follow-up Comment #3:
it seems that this fix runs into problems when movfun is called more if dim
changes to something that would fail the inputParser check the first time,
even if x was changed such that it should pass on the subsequent times. E.g.,
calling movfun in the following fashion in the same session:
>> x = magic (4);
>> movfun(@mean, x, 2, 'dim', 1)
ans =
16.0000 2.0000 3.0000 13.0000
10.5000 6.5000 6.5000 10.5000
7.0000 9.0000 8.0000 10.0000
6.5000 10.5000 10.5000 6.5000
>> x = cat(3,x,x)
x =
ans(:,:,1) =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
ans(:,:,2) =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
>> movfun(@mean, x, 2, 'dim', 3)
error: movfun: failed validation of 'dim'. Checked with "@(d) isempty (d) ||
(isscalar (d) && isindex (d, ndims (x)))"
error: called from
error at line 693 column 7
validate_arg at line 599 column 11
parse at line 517 column 11
movfun at line 195 column 3
>> clear all
>> clear -f
>> x = magic (4); x = cat(3, x, x)
x =
ans(:,:,1) =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
ans(:,:,2) =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
>> movfun(@mean, x, 2, 'dim', 3)
ans =
ans(:,:,1) =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
ans(:,:,2) =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
it seems that this is too persistent. reopening report.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65221>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature