Mercurial > hg > octave-avbm
changeset 8733:3ef774603887
rename all uses of sortrows_idx to sort_rows_idx
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 12 Feb 2009 15:16:35 -0500 |
parents | a669df7beb73 |
children | 767ed8cc6634 |
files | scripts/ChangeLog scripts/general/sortrows.m src/ChangeLog src/data.cc src/ov-base-diag.h src/ov-base-mat.h src/ov-base-scalar.h src/ov-base.cc src/ov-base.h src/ov-cell.cc src/ov-cell.h src/ov-perm.h src/ov-range.h src/ov.h |
diffstat | 14 files changed, 32 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2009-02-12 John W. Eaton <jwe@octave.org> + + * general/sortrows.m: Call __sort_rows_idx__, not __sortrows_idx__. + 2009-02-12 Soren Hauberg <hauberg@gmail.com> * help/gen_doc_cache.m: Change API so we only handle one directory per
--- a/scripts/general/sortrows.m +++ b/scripts/general/sortrows.m @@ -40,11 +40,11 @@ ## If the sort is homogeneous, we use the built-in faster algorithm. if (nargin == 1) - i = __sortrows_idx__ (m, default_mode); + i = __sort_rows_idx__ (m, default_mode); elseif (all (c > 0)) - i = __sortrows_idx__ (m(:,c), default_mode); + i = __sort_rows_idx__ (m(:,c), default_mode); elseif (all (c < 0)) - i = __sortrows_idx__ (m(:,c), other_mode); + i = __sort_rows_idx__ (m(:,c), other_mode); else ## Otherwise, fall back to the old algorithm for ii = 1:length (c);
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2009-02-12 John W. Eaton <jwe@octave.org> + * ov-base-diag.h, ov-base-mat.h, ov-base-scalar.h, ov-base.h, + ov-cell.h, ov-perm.h, ov-range.h, ov.h, data.cc, ov-base.cc, + ov-cell.cc: Rename all uses of sortrows_idx to sort_rows_idx. + * TEMPLATE-INST/Array-tc.cc: Don't instantiate sort functions for Arrays of octave_value objects. (octave_sort<octave_value>::ascending_compare,
--- a/src/data.cc +++ b/src/data.cc @@ -5574,9 +5574,9 @@ */ -DEFUN (__sortrows_idx__, args, , +DEFUN (__sort_rows_idx__, args, , "-*- texinfo -*-\n\ -@deftypefn {Function File} {} __sortrows_idx__ (@var{a}, @var{mode})\n\ +@deftypefn {Function File} {} __sort_rows_idx__ (@var{a}, @var{mode})\n\ Sort the rows of the matrix @var{a} according to the order specified\n\ by @var{mode}, which can either be `ascend' or `descend'.\n\ Returns the index vector.\n\ @@ -5604,7 +5604,7 @@ smode = DESCENDING; else { - error ("__sortrows_idx__: mode must be either \"ascend\" or \"descend\""); + error ("__sort_rows_idx__: mode must be either \"ascend\" or \"descend\""); return retval; } } @@ -5612,15 +5612,15 @@ octave_value arg = args(0); if (arg.is_sparse_type ()) - error ("__sortrows_idx__: sparse matrices not yet supported"); + error ("__sort_rows_idx__: sparse matrices not yet supported"); if (arg.ndims () == 2) { - Array<octave_idx_type> idx = arg.sortrows_idx (smode); + Array<octave_idx_type> idx = arg.sort_rows_idx (smode); retval = NDArray (idx, true); } else - error ("__sortrows_idx__: needs a 2-dimensional object"); + error ("__sort_rows_idx__: needs a 2-dimensional object"); return retval; }
--- a/src/ov-base-diag.h +++ b/src/ov-base-diag.h @@ -109,8 +109,8 @@ sortmode issorted (sortmode mode = UNSORTED) const { return to_dense ().issorted (mode); } - Array<octave_idx_type> sortrows_idx (sortmode mode = ASCENDING) const - { return to_dense ().sortrows_idx (mode); } + Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const + { return to_dense ().sort_rows_idx (mode); } sortmode issorted_rows (sortmode mode = UNSORTED) const { return to_dense ().issorted_rows (mode); }
--- a/src/ov-base-mat.h +++ b/src/ov-base-mat.h @@ -127,7 +127,7 @@ sortmode issorted (sortmode mode = UNSORTED) const { return matrix.is_sorted (mode); } - Array<octave_idx_type> sortrows_idx (sortmode mode = ASCENDING) const + Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const { return matrix.sort_rows_idx (mode); } sortmode issorted_rows (sortmode mode = UNSORTED) const
--- a/src/ov-base-scalar.h +++ b/src/ov-base-scalar.h @@ -111,7 +111,7 @@ sortmode issorted (sortmode mode = UNSORTED) const { return mode ? mode : ASCENDING; } - Array<octave_idx_type> sortrows_idx (sortmode) const + Array<octave_idx_type> sort_rows_idx (sortmode) const { return Array<octave_idx_type> (1, 0); } sortmode issorted_rows (sortmode mode = UNSORTED) const
--- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -996,9 +996,9 @@ } Array<octave_idx_type> -octave_base_value::sortrows_idx (sortmode) const +octave_base_value::sort_rows_idx (sortmode) const { - gripe_wrong_type_arg ("octave_base_value::sortrows_idx ()", type_name ()); + gripe_wrong_type_arg ("octave_base_value::sort_rows_idx ()", type_name ()); return Array<octave_idx_type> (); }
--- a/src/ov-base.h +++ b/src/ov-base.h @@ -519,7 +519,8 @@ virtual sortmode issorted (sortmode mode = UNSORTED) const; - virtual Array<octave_idx_type> sortrows_idx (sortmode mode = ASCENDING) const; + virtual Array<octave_idx_type> + sort_rows_idx (sortmode mode = ASCENDING) const; virtual sortmode issorted_rows (sortmode mode = UNSORTED) const;
--- a/src/ov-cell.cc +++ b/src/ov-cell.cc @@ -423,7 +423,7 @@ } Array<octave_idx_type> -octave_cell::sortrows_idx (sortmode mode) const +octave_cell::sort_rows_idx (sortmode mode) const { Array<octave_idx_type> retval;
--- a/src/ov-cell.h +++ b/src/ov-cell.h @@ -93,7 +93,7 @@ octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, sortmode mode = ASCENDING) const; - Array<octave_idx_type> sortrows_idx (sortmode mode = ASCENDING) const; + Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const; bool is_matrix_type (void) const { return false; }
--- a/src/ov-perm.h +++ b/src/ov-perm.h @@ -96,8 +96,8 @@ sortmode issorted (sortmode mode = UNSORTED) const { return to_dense ().issorted (mode); } - Array<octave_idx_type> sortrows_idx (sortmode mode = ASCENDING) const - { return to_dense ().sortrows_idx (mode); } + Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const + { return to_dense ().sort_rows_idx (mode); } sortmode issorted_rows (sortmode mode = UNSORTED) const { return to_dense ().issorted_rows (mode); }
--- a/src/ov-range.h +++ b/src/ov-range.h @@ -143,7 +143,7 @@ sortmode issorted (sortmode mode = UNSORTED) const { return range.is_sorted (mode); } - Array<octave_idx_type> sortrows_idx (sortmode) const + Array<octave_idx_type> sort_rows_idx (sortmode) const { return Array<octave_idx_type> (1, 0); } sortmode issorted_rows (sortmode mode = UNSORTED) const
--- a/src/ov.h +++ b/src/ov.h @@ -1002,8 +1002,8 @@ sortmode issorted (sortmode mode = UNSORTED) const { return rep->issorted (mode); } - Array<octave_idx_type> sortrows_idx (sortmode mode = ASCENDING) const - { return rep->sortrows_idx (mode); } + Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const + { return rep->sort_rows_idx (mode); } sortmode issorted_rows (sortmode mode = UNSORTED) const { return rep->issorted_rows (mode); }