bugGNU Octave - Bugs: bug #31165, error: inv: wrong type argument...

 
 

bug #31165: error: inv: wrong type argument "class"

Submitted by:  Lukas Reichlin <paramaniac>
Submitted on:  Thu 30 Sep 2010 03:49:03 AM UTC  
 
Category: NoneSeverity: 5 - Blocker
Priority: 7 - HighItem Group: None
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.3.52Operating System: Mac OS

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 11 Nov 2010 07:31:06 AM UTC, comment #2:

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/1783b360976f

It seems to fix the problem for me, so I'm closing this bug report.

John W. Eaton <jwe>
Project Administrator
Fri 01 Oct 2010 09:30:19 PM UTC, comment #1:

This problem is happening because the function out_of_date_check in symtab.cc is not properly handling classes that have parent classes with overloaded functions. In your case, you have defined @lti/inv.m and you are calling inv with a tf object. This works the first time because the initial lookup does notice that lti is a parent class of tf and so finds @lti/inv.m. On the second call, when a check is made to see whether the function has changed, the check for the parent class is omitted. The fix is to perform the check, but I'm not yet sure exactly the best way to do that.

John W. Eaton <jwe>
Project Administrator
Thu 30 Sep 2010 03:49:03 AM UTC, original submission:

Dear Octave Community

I noticed a problem with "inv" from Octave 3.3.52 and "control/inst/@lti/inv.m" [1]. Interestingly, the first attempt (see examples below) succeeds, while subsequent calls fail (inv: wrong type argument `class'). This problem doesn't occur on Octave 3.2.4. I'm using MacOSX 10.6.4 and an up-to-date MacPorts installation.

Thanks in advance for your help and best regards,
Lukas

[1]
control, SVN Revision 7781. "pkg install" takes about 90 seconds. First public release planned on arrival of Octave 3.4.
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/control/

IMPLEMENTATION NOTES:

  • "State-Space" (@ss/ss.m) and "Transfer Function" (@tf/tf.m) models are both inherited from class "Linear Time Invariant" (@lti/lti.m).
  • Overloaded operators like "inv" are located inside control/inst/@lti.
  • @lti/inv.m is also called by @lti/mrdivide.m (used in example 1)

## =======================
## Example 1
## =======================

GNU Octave, version 3.3.52
Copyright (C) 2010 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.

Octave was configured for "x86_64-apple-darwin10.4.0".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.

For information about changes from previous versions, type `news'.

octave:1> test_control
PASSES 66 out of 66 tests
PASSES 2 out of 2 tests
PASSES 2 out of 2 tests
PASSES 6 out of 6 tests
PASSES 3 out of 3 tests
PASSES 3 out of 3 tests
PASSES 3 out of 3 tests
PASSES 2 out of 2 tests
PASSES 5 out of 5 tests
PASSES 4 out of 4 tests
PASSES 3 out of 3 tests
PASSES 4 out of 4 tests
PASSES 1 out of 1 tests
PASSES 2 out of 2 tests
PASSES 2 out of 2 tests
PASSES 2 out of 2 tests
PASSES 1 out of 1 tests
PASSES 1 out of 1 tests
PASSES 16 out of 16 tests
octave:2> test_control

          • shared a

s = tf ("s");
G = (s+1)s5/(s+1)/(s^2+s+1);
a = G(1,1).num{1,1}(1);
!!!!! test failed
inv: wrong type argument `class'
shared variables {
a = [](octave:3> test_control
octave:4> test_control
octave:5>

BTW: Note the "forgotten" output after command 3 and 4. I've never seen such problems in Octave 3.2.x

## =======================
## Example 2
## =======================

octave:1> sys = ss (-1, 1, 1, 0)

sys.a =
x1
x1 -1

sys.b =
u1
x1 1

sys.c =
x1
y1 1

sys.d =
u1
y1 0

Continuous-time model.
octave:2> sysi = inv (sys)

sysi.e =
x1 x2
x1 1 0
x2 0 0

sysi.a =
x1 x2
x1 -1 1
x2 1 0

sysi.b =
u1
x1 0
x2 -1

sysi.c =
x1 x2
y1 0 1

sysi.d =
u1
y1 0

Continuous-time model.
octave:3> sysi = inv (sys)
error: inv: wrong type argument `class'
octave:3> which inv
`inv' is a function from the file /opt/local/libexec/octave/3.3.52/oct/x86_64-apple-darwin10.4.0/inv.oct
octave:4> sysi = inv (sys)
error: inv: wrong type argument `class'
octave:4> sysi = inv (sys)
error: inv: wrong type argument `class'
octave:4>

## =======================

Lukas Reichlin <paramaniac>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by paramaniac (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 11 Nov 2010 07:31:06 AM UTCjweStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Fri 01 Oct 2010 09:30:50 PM UTCjweSeverity3 - Normal=>5 - Blocker
    Fri 01 Oct 2010 09:30:19 PM UTCjwePriority5 - Normal=>7 - High
      StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1