Mercurial > hg > octave-lojdl
changeset 2255:fb9611cfc9d2
[project @ 1996-05-22 19:31:32 by jwe]
author | jwe |
---|---|
date | Wed, 22 May 1996 19:32:26 +0000 |
parents | 0158c64f940c |
children | 55f2ac8c7eb0 |
files | liboctave/chMatrix.cc liboctave/chMatrix.h |
diffstat | 2 files changed, 18 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/chMatrix.cc +++ b/liboctave/chMatrix.cc @@ -126,6 +126,21 @@ return retval; } +charMatrix +charMatrix::transpose (void) const +{ + int nr = rows (); + int nc = cols (); + charMatrix result (nc, nr); + if (length () > 0) + { + for (int j = 0; j < nc; j++) + for (int i = 0; i < nr; i++) + result.elem (j, i) = elem (i, j); + } + return result; +} + /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/liboctave/chMatrix.h +++ b/liboctave/chMatrix.h @@ -84,9 +84,11 @@ Matrix stack (const RowVector& a) const; Matrix stack (const ColumnVector& a) const; Matrix stack (const DiagMatrix& a) const; +#endif - Matrix transpose (void) const; + charMatrix transpose (void) const; +#if 0 friend Matrix real (const ComplexMatrix& a); friend Matrix imag (const ComplexMatrix& a);