Mercurial > hg > octave-terminal
changeset 88:0fcbd97505ae
[project @ 1993-09-09 22:40:16 by jwe]
(Matrix::transpose): Make it work for empty matrices.
(ComplexMatrix::transpose): Ditto.
author | jwe |
---|---|
date | Thu, 09 Sep 1993 22:40:16 +0000 |
parents | 8248ec41f677 |
children | 75a750fd15ce |
files | liboctave/Matrix.cc |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Matrix.cc +++ b/liboctave/Matrix.cc @@ -384,10 +384,9 @@ Matrix Matrix::transpose (void) const { - Matrix result; + Matrix result (nc, nr); if (len > 0) { - result.resize (nc, nr); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) result.data[nc*i+j] = data[nr*j+i]; @@ -2580,10 +2579,9 @@ ComplexMatrix ComplexMatrix::transpose (void) const { - ComplexMatrix result; + ComplexMatrix result (nc, nr); if (len > 0) { - result.resize (nc, nr); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) result.data[nc*i+j] = data[nr*j+i];