Mercurial > hg > octave-thorsten
diff liboctave/Sparse.cc @ 10703:5eb420d92307
fix sort and nth_element when trailing singleton dim is specified
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 14 Jun 2010 14:53:11 +0200 |
parents | ec3cec8277df |
children | f7f26094021b |
line wrap: on
line diff
--- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -2050,7 +2050,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.columns (); - if (m.length () < 1) + if (m.length () < 1 || dim > 1) return m; if (dim > 0) @@ -2116,9 +2116,9 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.columns (); - if (m.length () < 1) + if (m.length () < 1 || dim > 1) { - sidx = Array<octave_idx_type> (dim_vector (nr, nc)); + sidx = Array<octave_idx_type> (dim_vector (nr, nc), 1); return m; }