comparison src/Cell.cc @ 9813:8fa32b527d9a

improve & partially revert previous change
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 13 Nov 2009 11:45:39 +0100
parents f80c566bc751
children 64a06079cae4
comparison
equal deleted inserted replaced
9812:f80c566bc751 9813:8fa32b527d9a
264 Array<octave_value>::insert (a, ra_idx); 264 Array<octave_value>::insert (a, ra_idx);
265 return *this; 265 return *this;
266 } 266 }
267 267
268 Cell 268 Cell
269 Cell::map (unary_mapper_t umap) const 269 Cell::map (ctype_mapper fcn) const
270 { 270 {
271 Cell retval (dims ()); 271 Cell retval (dims ());
272 octave_value *r = retval.fortran_vec (); 272 octave_value *r = retval.fortran_vec ();
273 273
274 const octave_value *p = data (); 274 const octave_value *p = data ();
275 275
276 for (octave_idx_type i = 0; i < numel (); i++) 276 for (octave_idx_type i = 0; i < numel (); i++)
277 { 277 r[i] = ((p++)->*fcn) ();
278 r[i] = p[i].map (umap);
279 if (error_state)
280 break;
281 }
282 278
283 return retval; 279 return retval;
284 } 280 }
285 281
286 Cell 282 Cell