Mercurial > hg > octave-nkf
comparison src/ov-base-scalar.h @ 12647:e38fb1910563 stable
Allow sortrows to work on arrays with one row (bug #33197)
* ov-base-scalar.h (octave_base_scalar<T>::sort_rows_idx):
Return single index, not empty index array.
From Marco Caliari <marco.caliari@univr.it>.
* sortrows.m: New test.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 04 May 2011 22:10:24 -0400 |
parents | 12df7854fa7c |
children | 72c96de7a403 |
comparison
equal
deleted
inserted
replaced
12646:eaba9d671fb7 | 12647:e38fb1910563 |
---|---|
107 | 107 |
108 sortmode is_sorted (sortmode mode = UNSORTED) const | 108 sortmode is_sorted (sortmode mode = UNSORTED) const |
109 { return mode ? mode : ASCENDING; } | 109 { return mode ? mode : ASCENDING; } |
110 | 110 |
111 Array<octave_idx_type> sort_rows_idx (sortmode) const | 111 Array<octave_idx_type> sort_rows_idx (sortmode) const |
112 { return Array<octave_idx_type> (dim_vector (1, 0)); } | 112 { |
113 return Array<octave_idx_type> (dim_vector (1, 1), | |
114 static_cast<octave_idx_type> (0)); | |
115 } | |
113 | 116 |
114 sortmode is_sorted_rows (sortmode mode = UNSORTED) const | 117 sortmode is_sorted_rows (sortmode mode = UNSORTED) const |
115 { return mode ? mode : ASCENDING; } | 118 { return mode ? mode : ASCENDING; } |
116 | 119 |
117 MatrixType matrix_type (void) const { return MatrixType::Diagonal; } | 120 MatrixType matrix_type (void) const { return MatrixType::Diagonal; } |