bugGNU Octave - Bugs: bug #41865, polyeig behavles slightly...

 
 

bug #41865: polyeig behavles slightly differently than matlab

Submitter:  Michael <mdunphy>
Submitted:  Thu 13 Mar 2014 10:46:57 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 15 Mar 2014 11:39:41 PM UTC, comment #1: 

Because this changes the return signature of the function I could not fix this on the stable branch.  I checked in a changeset which overhauls the function and will be a part of the 4.0 release (http://hg.savannah.gnu.org/hgweb/octave/rev/f57148641869).

Rik <rik5>
Group administrator
Thu 13 Mar 2014 10:46:57 PM UTC, original submission:  

polyeig.m returns eigenvalues as a diagonal matrix, whereas to be consistent with MATLAB, it should return the eigenvalues in a vector. Using the test case in the end of polyeig.m as an example,


C0 = [8, 0; 0, 4]; C1 = [1, 0; 0, 1];
[v,z] = polyeig (C0, C1);


In MATLAB we get:

>> whos v z
  Name      Size            Bytes  Class     Attributes
  v         2x2                32  double
  z         2x1                16  double


In Octave we get:

> whos v z
Variables in the current scope:
   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  =====
        v           2x2                         32  double
        z           2x2                         16  double



The fix should be to change

    varargout{1} = v;

to

    varargout{1} = diag (v);

at line 75

Michael <mdunphy>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #30913:  polyeig_edit.diff added by None (714B - text/x-diff - I edited polyeig.m as recommended)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mdunphy (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-03-15 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2014-03-15 None Attached File- Added polyeig_edit.diff, #30913

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code