bugGNU Octave - Bugs: bug #37411, Diagonal matrix attribution error...

 
 
Show feedback again

bug #37411: Diagonal matrix attribution error and diag function bugs

Submitted by:  None
Submitted on:  Thu Sep 20 12:13:08 2012  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Steffen HoernigOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.2
Operating System: Microsoft Windows

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Fri Sep 21 21:44:43 2012, comment #4:

Thanks to Arun's very generous contribution of a 75 USD Amazon gift certificate, I have rebased this change to the upcoming stable bugfixing release 3.6.4, which should happen within the next few weeks:

http://hg.savannah.gnu.org/hgweb/octave/graph/21467c7fc08f

Thank you very much, and I hope 3.6.4 meets your needs.

Jordi Gutiérrez Hermoso <jordigh>
Project Administrator
Fri Sep 21 13:16:19 2012, comment #3:

Please forgive for the lack of brevity, but I have to get this off my
chest...

This bug is very minor. In order to manifest itself, the following
conditions have to be met:

* You must create a diagonal matrix

* You must index the first row or column of this diagonal matrix
(indexing any other row or column won't trigger the bug)

* You must take this row or column vector, internally represented
as a diagonal matrix, and you must feed it back into the diag
function.

All three conditions at once are rare. Moreover, there is a simple
workaround: use diag(full(e1)) instead of diag(e1), and this
workaround doesn't affect semantics in Matlab.

I have a fix for this bug. It is for the development version, since I
could not do it cleanly without breaking API, and we cannot break API
for the stable version. It will thus have to wait until we can make
another major release.

However, it took me a long time to fix this bug. About 6 hours. I
don't really care about this bug, but I felt driven to fix it because
apparently two people care enough about the bug report it and assure
me that it happens in several places and that it's annoying and
counterintuitive bug. I disagree. It's a very minor bug that was
annoying to fix. I am therefore proposing the following: I will not
release my fix unless the people who care about having this bug fixed
tip me at my Paypal address: jordigh@octave.org. If you send me any
nonzero monetary reward for the time I've spent fixing this bug, I
will gladly apply my fix to the development version. If the amount is
of sufficient magnitude, I may reconsider reworking my fix so that it
doesn't break API and can go into the stable version, which will be
released much sooner than the next major version.

Alternatively, if paying me for fixing this bug is an insurmountable
financial burden for you, you may provide your own patch for this bug.
If the patch does not break anything important in Octave and it
follows our coding standards, I will gladly apply it.

I hope you agree this is a reasonable request.

Jordi Gutiérrez Hermoso <jordigh>
Project Administrator
Thu Sep 20 17:13:35 2012, comment #2:

I confirm the original poster's reported behavior. It's certainly counterintuitive the first time and behaves differently from Matlab (checked on 2011b on Win32), so any Matlab code will need a workaround in Octave like "full(eye(n))" instead of just "eye(n)". This could be reclassified as Matlab Compatibility instead of Incorrect Result though.

Arun Giridhar <arungiridhar>
Thu Sep 20 14:02:11 2012, comment #1:

This is fairly esoteric. Is this actually causing you any real trouble?

Jordi Gutiérrez Hermoso <jordigh>
Project Administrator
Thu Sep 20 12:13:08 2012, original submission:

The following code creates a square matrix with [1,0] on the diagonal and works fine

Now the following defines the unit vector e1 as a column of the identity matrix. Note that it wrongy inherits "diagonal matrix" status from Id.

As a result, the diag function returns the number 1 instead of the above diagonal matrix diag([1,0]):

Anonymous

 

(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 arungiridhar (Posted a comment)
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

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

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Sep 21 21:44:43 2012jordighStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Fri Sep 21 13:16:19 2012jordighStatusConfirmed=>In Progress
    Thu Sep 20 14:02:25 2012jordighStatusNone=>Confirmed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup