Suggestion for sort rows

John W. Eaton jwe at bevo.che.wisc.edu
Tue Apr 1 15:08:05 CDT 2008


On 31-Mar-2008, Richard Bovey wrote:

| 
| Below is an updated suggestion (the first suggestion did not reverse the
| order of the modes, which was incorrect). Below:
| 1) a diff with the octave 3.0.0 version
| 2) a test function
| 3) the full new suggestion

I applied the patch and made a few additional changes.  Instead of
using a separate function for tests, we usually put the tests at the
end of the .m file.  For example, I added these lines based on your
test function:

  %!shared x, idx
  %! [x, idx] = sortrows ([1, 1; 1, 2; 3, 6; 2, 7], [1, -2]);
  %!assert (x, [1, 2; 1, 1; 2, 7; 3, 6]);
  %!assert (idx, [2; 1; 4; 3]);

| I aimed to make the suggestion consistent with other octave code that I have
| seen. However I've not found the coding conventions, please would you
| provide a link to the coding conventions.

We don't have a formal document yet.

| I don't know what a hg changeset is.

It's a file containing diffs and some extra information for Mercurial
(hg) which is version control system we use for the Octave sources.
For more information about Mercurial, see

  http://www.selenic.com/mercurial/wiki

jwe


More information about the Bug-octave mailing list