Mercurial > hg > octave-nkf
diff liboctave/dMatrix.cc @ 3248:68259f410026
[project @ 1999-07-13 03:34:54 by jwe]
author | jwe |
---|---|
date | Tue, 13 Jul 1999 03:40:17 +0000 |
parents | 98d0ee053ba4 |
children | 13cdcb7e5066 |
line wrap: on
line diff
--- a/liboctave/dMatrix.cc +++ b/liboctave/dMatrix.cc @@ -1556,6 +1556,21 @@ return b.apply (f); } +boolMatrix +Matrix::map (b_d_Mapper f) const +{ + int nr = rows (); + int nc = cols (); + + boolMatrix retval (nr, nc); + + for (int j = 0; j < nc; j++) + for (int i = 0; i < nr; i++) + retval(i,j) = f (elem(i,j)); + + return retval; +} + Matrix& Matrix::apply (d_d_Mapper f) {