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

 
 

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

Submitter:  Lukas Reichlin <paramaniac>
Submitted:  Thu 30 Sep 2010 03:49:03 AM UTC
   
 
Category:  None Severity:  5 - Blocker
Priority:  7 - High Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.3.52 Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 12 Aug 2020 12:47:23 AM UTC, comment #3: 

Dear Octave Community:

I have this error message:

error: octave_base_value::permute (): wrong type argument 'class'

Can you explain me how to fix it using this?

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

I don't know how to do that.

Thanks you

Aldeinda <aldeluzbra>
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>
Group 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>
Group 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)*s*5/(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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by aldeluzbra (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by paramaniac (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-11-11 jwe StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2010-10-01 jwe Severity3 - Normal 5 - Blocker
    2010-10-01 jwe Priority5 - Normal 7 - High
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code