Sat 20 Aug 2016 08:40:56 PM UTC, comment #1:
I believe this is the same as bug #48802 that I found and reported recently. The problem is that function overloads are not respected when using a function handle, whether with cellfun or arrayfun or calling directly, and only when the method is defined within the "methods" block of a classdef definition.
If the method is defined in a separate @someclass/size.m function file, then it works correctly.
|
Sat 20 Aug 2016 07:53:28 PM UTC, original submission:
Dear Octave,
carandraug (irc) asked me to report this bug.
I am using casadi, a computer algebra system, which has its own classes.
x is a casadi SX object. I don't know anything about classes, and can't provide a test class.
But, if this limited information helps, here's an interesting bug:
octave:4> version ## on debian gnu/linux, from jessie-backports.
ans = 4.0.3
(Create a SX object: octave:2> x=SX.sym('x', 1, 2))
## Using package symbolic.
octave:3> size(x)
ans =
1 2
octave:6> cellfun(@size, {x}, 'unif' , false)
ans =
{
[1,1] =
1 1
}
## wrong size.
## Let's try workarounds :
octave:7> cellfun(@(x)size(x), {x}, 'unif' , false)
ans =
{
[1,1] =
1 1
}
octave:8> cellfun(@(x) feval(@size, x), {x}, 'unif' , false)
ans =
{
[1,1] =
1 1
}
## no luck, still. (So, I resorted to a loop, eventually.)
Dave
|