Mercurial > hg > octave-lyh
changeset 4711:5101dffb4178
[project @ 2004-01-22 19:30:54 by jwe]
author | jwe |
---|---|
date | Thu, 22 Jan 2004 19:30:54 +0000 |
parents | 48191fcee04d |
children | b7e7a31dbfb1 |
files | liboctave/Array.cc liboctave/ChangeLog |
diffstat | 2 files changed, 8 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -2733,24 +2733,13 @@ Array<int> result_idx (lhs_dims.length (), 0); - Array<int> elt_idx; - RT scalar = rhs.elem (0); for (int i = 0; i < n; i++) { - elt_idx = get_elt_idx (idx, result_idx); - - dim_vector lhs_inc; - lhs_inc.resize (lhs_dims.length ()); - - for (int j = 0; j < lhs_dims.length (); j++) - lhs_inc(j) = lhs_dims(j) + 1; - - if (index_in_bounds(elt_idx, lhs_inc)) - lhs.checkelem (elt_idx) = scalar; - else - lhs.checkelem (elt_idx) = rfv; + Array<int> elt_idx = get_elt_idx (idx, result_idx); + + lhs.checkelem (elt_idx) = scalar; increment_index (result_idx, frozen_len); }
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2004-01-22 Petter Risholm <risholm@stud.ntnu.no> + + * Array.cc (Array<T>::assignN): Eliminate unnecessray code for + filling when RHS is scalar and dimension lengths agree. + 2004-01-22 John W. Eaton <jwe@bevo.che.wisc.edu> * Makefile.in (distclean): Remove $(MX_OP_INC), $(VX_OP_INC),