Mercurial > hg > octave-lyh
changeset 4940:954cc2ba6a49
[project @ 2004-08-24 19:30:31 by jwe]
author | jwe |
---|---|
date | Tue, 24 Aug 2004 19:32:46 +0000 |
parents | 22388c7625a0 |
children | 6af62cc045f7 |
files | liboctave/CNDArray.cc liboctave/ChangeLog liboctave/chNDArray.cc liboctave/dNDArray.cc liboctave/dim-vector.h |
diffstat | 5 files changed, 22 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/CNDArray.cc +++ b/liboctave/CNDArray.cc @@ -658,7 +658,7 @@ const Array<int>& ra_idx) { ComplexNDArray retval (ra); - if (ra.numel () > 0) + if (rb.numel () > 0) retval.insert (rb, ra_idx); return retval; } @@ -668,7 +668,7 @@ { ComplexNDArray retval (ra); ComplexNDArray tmp (rb); - if (ra.numel () > 0) + if (rb.numel () > 0) retval.insert (tmp, ra_idx); return retval; } @@ -677,7 +677,7 @@ concat (const NDArray& ra, const ComplexNDArray& rb, const Array<int>& ra_idx) { ComplexNDArray retval (ra); - if (ra.numel () > 0) + if (rb.numel () > 0) retval.insert (rb, ra_idx); return retval; }
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,15 @@ +2004-08-24 David Bateman <dbateman@free.fr> + + * chNDArray.cc (concat): Check whether matrix to be inserted is + empty instead of checking final matrix. + * dNDArray.cc (concat): Likewise. + * CNDArray.cc (concat): Likewise. + +2004-08-23 David Bateman <dbateman@free.fr> + + * dim-vector.h (dim_vector::concat): Correct incrementation for + non-existent dimensions. + 2004-08-09 John W. Eaton <jwe@octave.org> * idx-vector.h (idx_vector::idx_vector_rep::tree_to_mat_idx
--- a/liboctave/chNDArray.cc +++ b/liboctave/chNDArray.cc @@ -53,7 +53,7 @@ concat (const charNDArray& ra, const charNDArray& rb, const Array<int>& ra_idx) { charNDArray retval (ra); - if (ra.numel () > 0) + if (rb.numel () > 0) retval.insert (rb, ra_idx); return retval; } @@ -65,7 +65,7 @@ charNDArray tmp (rb.dims ()); int nel = rb.numel (); - if (ra.numel () == 0) + if (rb.numel () == 0) return retval; for (int i = 0; i < nel; i++) @@ -124,6 +124,9 @@ } } + if (rb.numel () == 0) + return retval; + retval.insert (rb, ra_idx); return retval; }