Mercurial > hg > octave-lyh
diff src/ov-flt-complex.cc @ 8437:f00578b495e9
remove valid_as_scalar_index
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sat, 27 Dec 2008 17:01:52 +0100 |
parents | a41df65f3f00 |
children | eb63fbe60fab |
line wrap: on
line diff
--- a/src/ov-flt-complex.cc +++ b/src/ov-flt-complex.cc @@ -71,28 +71,19 @@ octave_value octave_float_complex::do_index_op (const octave_value_list& idx, bool resize_ok) { - octave_value retval; + // FIXME -- this doesn't solve the problem of + // + // a = i; a([1,1], [1,1], [1,1]) + // + // and similar constructions. Hmm... - if (idx.valid_scalar_indices ()) - retval = scalar; - else - { - // FIXME -- this doesn't solve the problem of - // - // a = i; a([1,1], [1,1], [1,1]) - // - // and similar constructions. Hmm... + // FIXME -- using this constructor avoids narrowing the + // 1x1 matrix back to a scalar value. Need a better solution + // to this problem. - // FIXME -- using this constructor avoids narrowing the - // 1x1 matrix back to a scalar value. Need a better solution - // to this problem. + octave_value tmp (new octave_float_complex_matrix (float_complex_matrix_value ())); - octave_value tmp (new octave_float_complex_matrix (float_complex_matrix_value ())); - - retval = tmp.do_index_op (idx, resize_ok); - } - - return retval; + return tmp.do_index_op (idx, resize_ok); } double