# HG changeset patch # User jwe # Date 863422011 0 # Node ID 0a2551ec7004c301cf61b2fbc163e88350c3b8a1 # Parent c0c280cda856761cdf647cc199f4a16ee18b31ad [project @ 1997-05-12 07:26:50 by jwe] diff -r c0c280cda856 -r 0a2551ec7004 liboctave/CMatrix.cc --- a/liboctave/CMatrix.cc Mon May 12 03:29:38 1997 +0000 +++ b/liboctave/CMatrix.cc Mon May 12 07:26:51 1997 +0000 @@ -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 diff -r c0c280cda856 -r 0a2551ec7004 liboctave/CMatrix.h --- a/liboctave/CMatrix.h Mon May 12 03:29:38 1997 +0000 +++ b/liboctave/CMatrix.h Mon May 12 07:26:51 1997 +0000 @@ -200,7 +200,7 @@ // unary operations - Matrix operator ! (void) const; + boolMatrix operator ! (void) const; // other operations diff -r c0c280cda856 -r 0a2551ec7004 liboctave/ChangeLog --- a/liboctave/ChangeLog Mon May 12 03:29:38 1997 +0000 +++ b/liboctave/ChangeLog Mon May 12 07:26:51 1997 +0000 @@ -1,3 +1,8 @@ +Mon May 12 02:14:13 1997 John W. Eaton + + * CMatrix.cc (ComplexMatrix::operator !): Return boolMatrix. + * dMatrix.cc (Matrix::operator !): Likewise + Wed May 7 21:14:06 1997 John W. Eaton * oct-syscalls.h, oct-syscalls.cc: New files. diff -r c0c280cda856 -r 0a2551ec7004 liboctave/dMatrix.cc --- a/liboctave/dMatrix.cc Mon May 12 03:29:38 1997 +0000 +++ b/liboctave/dMatrix.cc Mon May 12 07:26:51 1997 +0000 @@ -1517,13 +1517,13 @@ // unary operations -Matrix +boolMatrix Matrix::operator ! (void) const { int nr = rows (); int nc = cols (); - Matrix b (nr, nc); + boolMatrix b (nr, nc); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) diff -r c0c280cda856 -r 0a2551ec7004 liboctave/dMatrix.h --- a/liboctave/dMatrix.h Mon May 12 03:29:38 1997 +0000 +++ b/liboctave/dMatrix.h Mon May 12 07:26:51 1997 +0000 @@ -171,7 +171,7 @@ // unary operations - Matrix operator ! (void) const; + boolMatrix operator ! (void) const; // column vector by row vector -> matrix operations