Mercurial > hg > octave-lojdl
changeset 1563:562fed28ce22
[project @ 1995-10-15 03:29:14 by jwe]
author | jwe |
---|---|
date | Sun, 15 Oct 1995 03:29:14 +0000 |
parents | 1cff14ab83a4 |
children | 0104de09d365 |
files | src/sort.cc |
diffstat | 1 files changed, 32 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sort.cc +++ b/src/sort.cc @@ -164,7 +164,14 @@ Matrix ms (nr, nc); Matrix idx (nr, nc); - if (nr > 0 && nc > 0) + if (nr == 1 && nc > 0) + { + retval (1) = Matrix (nr, nc, 1.0); + retval (0) = m; + + return retval; + } + else if (nr > 1 && nc > 0) { for (int j = 0; j < nc; j++) { @@ -192,7 +199,14 @@ RowVector vs (n); RowVector idx (n); - if (n > 0) + if (n == 1) + { + retval (1) = RowVector (n, 1.0); + retval (0) = v; + + return retval; + } + else if (n > 1) { Array<int> l = create_index_array (n); @@ -218,7 +232,14 @@ ComplexMatrix cms (nr, nc); Matrix idx (nr, nc); - if (nr > 0 && nc > 0) + if (nr == 1 && nc > 0) + { + retval (1) = Matrix (nr, nc, 1.0); + retval (0) = cm; + + return retval; + } + else if (nr > 1 && nc > 0) { for (int j = 0; j < nc; j++) { @@ -256,7 +277,14 @@ ComplexRowVector cvs (n); RowVector idx (n); - if (n > 0) + if (n == 1) + { + retval (1) = RowVector (n, 1.0); + retval (0) = cv; + + return retval; + } + else if (n > 1) { Array<int> l = create_index_array (n);