Mercurial > hg > octave-avbm
changeset 2245:aaeccf9e1d32
[project @ 1996-05-22 05:21:16 by jwe]
author | jwe |
---|---|
date | Wed, 22 May 1996 05:21:20 +0000 |
parents | d864935059f4 |
children | a6791c6486fa |
files | liboctave/Array-idx.h liboctave/Array2-idx.h |
diffstat | 2 files changed, 36 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array-idx.h +++ b/liboctave/Array-idx.h @@ -118,13 +118,23 @@ if (num_to_delete != 0) { - int new_len = len - num_to_delete; + int new_len = len; + + int iidx = 0; + + for (int i = 0; i < len; i++) + if (i == idx.elem (iidx)) + { + iidx++; + new_len--; + } + if (new_len > 0) { T *new_data = new T [new_len]; int ii = 0; - int iidx = 0; + iidx = 0; for (int i = 0; i < len; i++) { if (i == idx.elem (iidx))
--- a/liboctave/Array2-idx.h +++ b/liboctave/Array2-idx.h @@ -208,13 +208,23 @@ resize (0, 0); else { - int new_nc = nc - num_to_delete; + int new_nc = nc; + + int idx = 0; + + for (int j = 0; j < nc; j++) + if (j == idx_j.elem (idx)) + { + idx++; + new_nc--; + } + if (new_nc > 0) { T *new_data = new T [nr * new_nc]; int jj = 0; - int idx = 0; + idx = 0; for (int j = 0; j < nc; j++) { if (j == idx_j.elem (idx)) @@ -257,13 +267,23 @@ resize (0, 0); else { - int new_nr = nr - num_to_delete; + int new_nr = nr; + + int idx = 0; + + for (int i = 0; i < nr; i++) + if (i == idx_i.elem (idx)) + { + idx++; + new_nr--; + } + if (new_nr > 0) { T *new_data = new T [new_nr * nc]; int ii = 0; - int idx = 0; + idx = 0; for (int i = 0; i < nr; i++) { if (i == idx_i.elem (idx))