# HG changeset patch # User jwe # Date 832793546 0 # Node ID fb9611cfc9d26a0af5ba970936ad54469f176fd6 # Parent 0158c64f940cbb0bd2802c1fa55f97f13049a7fb [project @ 1996-05-22 19:31:32 by jwe] diff --git a/liboctave/chMatrix.cc b/liboctave/chMatrix.cc --- 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++ *** diff --git a/liboctave/chMatrix.h b/liboctave/chMatrix.h --- 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);