bugGNU Octave - Bugs: bug #40578, OF linear-algebra: typo in...

 
 

bug #40578: OF linear-algebra: typo in @kronprod/iscomplex.m

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Thu 14 Nov 2013 12:28:45 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * other Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 15 Nov 2013 06:03:04 AM UTC, comment #7: 

Yes, I ran the test suite with _run_test_suite_ in linux with only the linear-algebra package loaded.

Carnë Draug <carandraug>
Group Member
Thu 14 Nov 2013 10:08:06 PM UTC, comment #6: 

jwe himself fixed it - well then we can close this bug report.

As to _run_test_suite_ : I ran it on Windows (MinGW). Did you run it on Linux?
Ah never mind, if it persists I'll file another bug report for that.

Philip Nienhuis <philipnienhuis>
Group Member
Thu 14 Nov 2013 06:38:26 PM UTC, comment #5: 

No, linear-algebra has already been moved to hg. And turns out that this bug has already been fixed by jwe with cset a29567b4b299.


The fact that the test in cellfun is using the @kronprod/iscomplex may be a separate issue since it should be used only for the kronprod class. But I can't reproduce it. Even while after loading the linear-algebra package with the buggy @kronprod/iscomplex.m, _run_test_suite_ does not error with cellfun.

Carnë Draug <carandraug>
Group Member
Thu 14 Nov 2013 05:39:37 PM UTC, comment #4: 

@ Carnë: is linear-algebra still in sv? If so I'll commit it. If not, I hope someone else can.

Philip Nienhuis <philipnienhuis>
Group Member
Thu 14 Nov 2013 05:37:54 PM UTC, comment #3: 

I think the iscomplex() shadowing is a bit of a side-issue. _run_test_suite_.m is undocumented and I haven't checked it out yet, so perhaps it is just rong invocation by me.

As to my Octave setup:
I hit this on a plain, normal cross-built MinGW Octave (tip from yesterday evening; unfortunately hg id's aren't kept in e.g., octave_config_info and as I'm on Windows now I can't check).

No claims from me this MXE builds are perfect; but it is built using the standard mxe-octave build chain.

I know about expected shadowing behavior with overloaded classes. Doesn't seem to work as advertised in this case.

FYI,

>> which __run_test_suite__
'__run_test_suite__' is a function from the file X:\Octave\octave-2013-11-12-15-36\share\octave\3.7.7+\m\testfun\__run_test_suite__.m
>>
:
>> which iscomplex
'iscomplex' is a built-in function from the file libinterp/corefcn/data.cc
>> pkg load general linear-algebra
>> which iscomplex
'iscomplex' is a built-in function from the file libinterp/corefcn/data.cc
>> __run_test_suite__

Integrated test scripts:

  libinterp\corefcn\__contourc__.cc-tst .................. PASS    1/1
  libinterp\corefcn\__dispatch__.cc-tst .................. PASS    1/1
  libinterp\corefcn\__lin_interpn__.cc-tst ............... PASS    1/1
  libinterp\corefcn\__pchip_deriv__.cc-tst ............... PASS    1/1
  libinterp\corefcn\__qp__.cc-tst ........................ PASS    1/1
  libinterp\corefcn\besselj.cc-tst ....................... PASS  191/191
  libinterp\corefcn\betainc.cc-tst ....................... PASS   23/23
  libinterp\corefcn\bsxfun.cc-tst ........................ PASS   73/73
  libinterp\corefcn\cellfun.cc-tst ....................... PASS  127/129  FAIL
2
: Ctrl-C


and fntests.log says:


>>>>> processing X:\Octave\octave-2013-11-12-15-36\share\octave\3.7.7+\etc\tests\libinterp\corefcn\cellfun.cc-tst
  ***** assert (cellfun (@iscomplex, {1 inf nan []}), [false, false, false, false]);
!!!!! test failed
parse error near line 31 of file X:\Octave\octave-2013-11-12-15-36\share\octave\packages\linear-algebra-2.2.0\@kronprod\iscomplex.m

  syntax error

>>>   retval = (iscomplex (KP.A) || iscomplex (KP.B);
                                                    ^

  ***** assert (cellfun (@iscomplex, {1 inf nan []}, "UniformOutput", false), {false, false, false, false});
!!!!! test failed
parse error near line 31 of file X:\Octave\octave-2013-11-12-15-36\share\octave\packages\linear-algebra-2.2.0\@kronprod\iscomplex.m

  syntax error

>>>   retval = (iscomplex (KP.A) || iscomplex (KP.B);


I suppose it is better to unload all OF packages before running tests for core Octave.

Philip Nienhuis <philipnienhuis>
Group Member
Thu 14 Nov 2013 05:23:05 PM UTC, comment #2: 

Philip, can you push the change to the linear-algebra hg repo? You should have commit access to it.

Carnë Draug <carandraug>
Group Member
Thu 14 Nov 2013 02:15:54 PM UTC, comment #1: 

Patch looks simple enough and correct.

This iscomplex, and any function under an @ directory, should only be called when the argument is of the matching class type.

If "which iscomplex" shows "built-in function" then I'm not sure why this function would be called from run_test_suite (any arguments to that call?). If "which iscomplex" shows path/to/linear-algebra-x.y.z/@kronprod/iscomplex.m instead, then there's a problem with how your Octave path is being set up.

Mike Miller <mtmiller>
Group Member
Thu 14 Nov 2013 12:28:45 PM UTC, original submission:  

Patch (diff -u) attached, should be self-explaining.

On a more general note, how does this iscomplex.m differ from Octave's built-in core iscomplex.m?
From what I understand it looks like it works on class KP but I see no fall-back to the core-octave one for non-KP arguments. Which explains how I hit the bug:

I was running _run_test_suite_ in a MinGW buid and got two cellfun.c FAILs, caused by shadowing of iscomplex() by this OF-linear-algebra version of iscomplex.m

Philip Nienhuis <philipnienhuis>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #29618:  iscomplex.m.diff added by philipnienhuis (380B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by philipnienhuis (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-11-14 philipnienhuis StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2013-11-14 mtmiller StatusNone Patch Submitted
    2013-11-14 philipnienhuis Attached File- Added iscomplex.m.diff, #29618

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code