Mercurial > hg > octave-lyh
changeset 2964:0a2551ec7004
[project @ 1997-05-12 07:26:50 by jwe]
author | jwe |
---|---|
date | Mon, 12 May 1997 07:26:51 +0000 |
parents | c0c280cda856 |
children | a51926eab51a |
files | liboctave/CMatrix.cc liboctave/CMatrix.h liboctave/ChangeLog liboctave/dMatrix.cc liboctave/dMatrix.h |
diffstat | 5 files changed, 20 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/CMatrix.cc +++ b/liboctave/CMatrix.cc @@ -1908,10 +1908,19 @@ // unary operations -Matrix +boolMatrix ComplexMatrix::operator ! (void) const { - return Matrix (not (data (), length ()), rows (), cols ()); + int nr = rows (); + int nc = cols (); + + boolMatrix b (nr, nc); + + for (int j = 0; j < nc; j++) + for (int i = 0; i < nr; i++) + b.elem (i, j) = elem (i, j) != 0.0; + + return b; } // other operations
--- a/liboctave/CMatrix.h +++ b/liboctave/CMatrix.h @@ -200,7 +200,7 @@ // unary operations - Matrix operator ! (void) const; + boolMatrix operator ! (void) const; // other operations
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +Mon May 12 02:14:13 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * CMatrix.cc (ComplexMatrix::operator !): Return boolMatrix. + * dMatrix.cc (Matrix::operator !): Likewise + Wed May 7 21:14:06 1997 John W. Eaton <jwe@bevo.che.wisc.edu> * oct-syscalls.h, oct-syscalls.cc: New files.