bugGNU Octave - Bugs: bug #40808, setxor function produces incorrect...

 
 

bug #40808: setxor function produces incorrect result with 'row' argument

Submitted by:  None
Submitted on:  Wed 04 Dec 2013 05:16:02 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: David SzepesvariOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.4
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 04 Dec 2013 10:59:30 PM UTC, comment #1:

I committed your changeset and also added a test for the correct behavior in the m-file (http://hg.savannah.gnu.org/hgweb/octave/rev/42df174ec2ff).

The number of rows, na and nb, is used at the bottom of the m-file if the function returns 3 arguments. 'n' was used, I think, to try and make the algorithm cleaner. It may be marginally (like a few tens of microseconds) faster than using the 'end' keyword since that would have to be checked each time it appears and 'n' is a constant.

Rik <rik5>
Project Administrator
Wed 04 Dec 2013 05:16:02 PM UTC, original submission:

produces:

when what I expect (and is outputted by Matlab):
or

I attached the fixed setxor.m file. It is only line 64 (in the attached file),
that is changed to

Unrelated:
Why is the number of rows of a and b counted, if these are not used. Also, the rows of c are saved into n, end then 'n-1' is used for indexing; is there a particular reason for not using 'end-1'?

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #29787:  setxor.m added by None (3KiB - d2l/unknowntype)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  •  

    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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 04 Dec 2013 10:59:30 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 04 Dec 2013 05:16:02 PM UTCNoneAttached File-=>Added setxor.m, #29787

    Back to the top


    Powered by Savane 3.1-cleanup1