bugGNU Octave - Bugs: bug #33197, sortrows does not work with single...

 
 

bug #33197: sortrows does not work with single row arrays

Submitted by:  None
Submitted on:  Mon 02 May 2011 04:44:22 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: None
Originator Name: asppsaOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.4.0
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.

 

Thu 05 May 2011 02:19:05 AM UTC, comment #3:

I checked in the following change on the stable branch:

http://hg.savannah.gnu.org/hgweb/octave/rev/e38fb1910563

John W. Eaton <jwe>
Project Administrator
Mon 02 May 2011 01:07:04 PM UTC, comment #2:

I can fix the problem if I replace

with

which is somehow similar to the result of sort some lines above. But maybe it is safer to modify sortrows.m with something like

Marco

Marco Caliari <caliari>
Project Member
Mon 02 May 2011 01:04:37 PM UTC, comment #1:

I confirm the problem.

When you call sortrows with a row as first argument and a scalar as second argument, then sort_rows_idx in ov-base-scalar.h is called, which gives an empty vector 1x0 as output. I don't know if there is a reason for that. I can fix the problem if I replace

Marco Caliari <caliari>
Project Member
Mon 02 May 2011 04:44:22 AM UTC, original submission:

Hello,

I have encountered a problem with the sortrows function, in that it doesn't seem to be able to deal with arrays with only one row.

To reproduce my problem, try the following:

or:

On my machine, the return is a 0xn matrix, where n is the number of columns in the input matrix. So, the row has disappeared, whereas I would have expected it to return the row unaltered.

Running sortrows on matrices with two or more rows seems to work as expected.

This isn't a big issue for me as it is easy enough to wrap calls to sortrows in an "if" statement, but I thought it might cause compatibility issues and/or confusion.

I'm using a pre-compiled Arch Linux GNU Octave package on a 32 bit Intel computer.

If you need any more information from me, please let me know.

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 jwe (Posted a comment)
  • -unavailable- added by caliari (Posted a comment)
  • -unavailable- added by None (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 05 May 2011 02:19:05 AM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1