Mercurial > hg > octave-nkf
diff src/Cell.cc @ 7530:bb0f2353cff5
new cell array ctype mappers
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 25 Feb 2008 19:01:30 -0500 |
parents | f06b8150fe56 |
children | 3209a584e1ac |
line wrap: on
line diff
--- a/src/Cell.cc +++ b/src/Cell.cc @@ -224,6 +224,20 @@ return *this; } +Cell +Cell::map (ctype_mapper fcn) const +{ + Cell retval (dims ()); + octave_value *r = retval.fortran_vec (); + + const octave_value *p = data (); + + for (octave_idx_type i = 0; i < numel (); i++) + r[i] = ((p++)->*fcn) (); + + return retval; +} + /* ;;; Local Variables: *** ;;; mode: C++ ***