Mercurial > hg > octave-max
changeset 4533:ed2990fab58f
[project @ 2003-10-10 02:13:33 by jwe]
author | jwe |
---|---|
date | Fri, 10 Oct 2003 02:15:46 +0000 |
parents | 01ee68d18069 |
children | e8355721a809 |
files | liboctave/Array.cc liboctave/ChangeLog |
diffstat | 2 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -1950,7 +1950,7 @@ (*current_liboctave_error_handler) ("attempt to grow array along ambiguous dimension"); else - retval.Array<T>::checkelem (numelem_result) = Array<T>::checkelem (numelem_elt); + retval.checkelem (numelem_result) = checkelem (numelem_elt); increment_index (result_idx, frozen_lengths); @@ -2460,7 +2460,14 @@ if (n_idx == 0) (*current_liboctave_error_handler) ("number of indices is zero"); - + else if (n_idx == 1) + { + Array<int> one_arg_temp (1, 0); + + RT scalar = rhs.elem (one_arg_temp); + + lhs.fill (scalar); + } else if (n_idx < lhs_dims.length ()) { // Number of indices is less than dimensions. @@ -2519,7 +2526,7 @@ (*current_liboctave_error_handler) ("attempt to grow array along ambiguous dimension"); else - lhs.Array<LT>::checkelem (numelem) = scalar; + lhs.checkelem (numelem) = scalar; } } else @@ -2554,7 +2561,7 @@ } } } - else if (rhs_dims.length () >= 2) + else if (rhs_dims.length () > 1) { // RHS is matrix or higher dimension.
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,5 +1,7 @@ 2003-10-09 John W. Eaton <jwe@bevo.che.wisc.edu> + * Array.cc (assignN): Allow lhs(:) = scalar. + * CNDArray.cc (ComplexNDArray::increment_index): New function. * dNDArray.cc (NDArray::increment_index): Likewise. * boolNDArray.cc (boolNDArray::increment_index): Likewise.