# HG changeset patch # User Carnë Draug # Date 1432952047 -3600 # Node ID a9574e3c6e9e7be960eb7afb3150ecb76d33711f # Parent 83792dd9bcc18bc4559e77998f5d6fe32430078a Deprecate Array::length() and Sparse::length() in favour of ::numel(). * liboctave/array/Array.h (Array::length): deprecate for ::numel. * liboctave/array/Sparse.h (Sparse::length): deprecate for ::numel. * libgui/graphics/QtHandlesUtils.cc, libgui/src/octave-qt-link.cc, libinterp/corefcn/Cell.cc, libinterp/corefcn/__contourc__.cc, libinterp/corefcn/__pchip_deriv__.cc, libinterp/corefcn/__qp__.cc, libinterp/corefcn/cellfun.cc, libinterp/corefcn/daspk.cc, libinterp/corefcn/dasrt.cc, libinterp/corefcn/dassl.cc, libinterp/corefcn/data.cc, libinterp/corefcn/filter.cc, libinterp/corefcn/find.cc, libinterp/corefcn/gl-render.cc, libinterp/corefcn/gl-render.h, libinterp/corefcn/graphics.cc, libinterp/corefcn/graphics.in.h, libinterp/corefcn/help.cc, libinterp/corefcn/hex2num.cc, libinterp/corefcn/input.cc, libinterp/corefcn/load-path.cc, libinterp/corefcn/load-save.cc, libinterp/corefcn/ls-oct-ascii.h, libinterp/corefcn/lsode.cc, libinterp/corefcn/matrix_type.cc, libinterp/corefcn/oct-hist.cc, libinterp/corefcn/oct-map.cc, libinterp/corefcn/oct-map.h, libinterp/corefcn/oct-obj.h, libinterp/corefcn/oct-stream.cc, libinterp/corefcn/oct-stream.h, libinterp/corefcn/pr-output.cc, libinterp/corefcn/quadcc.cc, libinterp/corefcn/rand.cc, libinterp/corefcn/regexp.cc, libinterp/corefcn/strfns.cc, libinterp/corefcn/sub2ind.cc, libinterp/corefcn/symtab.h, libinterp/corefcn/syscalls.cc, libinterp/corefcn/tsearch.cc, libinterp/corefcn/urlwrite.cc, libinterp/corefcn/utils.cc, libinterp/corefcn/variables.cc, libinterp/corefcn/xdiv.cc, libinterp/corefcn/xpow.cc, libinterp/dldfcn/__glpk__.cc, libinterp/dldfcn/__init_fltk__.cc, libinterp/dldfcn/__magick_read__.cc, libinterp/dldfcn/audiodevinfo.cc, libinterp/dldfcn/ccolamd.cc, libinterp/dldfcn/colamd.cc, libinterp/octave-value/ov-cell.cc, libinterp/octave-value/ov-class.cc, libinterp/octave-value/ov-class.h, libinterp/octave-value/ov-fcn-inline.cc, libinterp/octave-value/ov-java.cc, libinterp/octave-value/ov-perm.cc, libinterp/octave-value/ov-struct.cc, libinterp/octave-value/ov-typeinfo.cc, libinterp/octave-value/ov.cc, libinterp/operators/op-int.h, libinterp/parse-tree/pt-pr-code.cc, liboctave/array/Array-util.cc, liboctave/array/Array.cc, liboctave/array/CColVector.cc, liboctave/array/CDiagMatrix.cc, liboctave/array/CMatrix.cc, liboctave/array/CRowVector.cc, liboctave/array/DiagArray2.cc, liboctave/array/DiagArray2.h, liboctave/array/MArray.cc, liboctave/array/PermMatrix.cc, liboctave/array/PermMatrix.h, liboctave/array/Sparse.cc, liboctave/array/boolMatrix.cc, liboctave/array/chMatrix.cc, liboctave/array/chNDArray.cc, liboctave/array/dColVector.cc, liboctave/array/dDiagMatrix.cc, liboctave/array/dMatrix.cc, liboctave/array/dRowVector.cc, liboctave/array/fCColVector.cc, liboctave/array/fCDiagMatrix.cc, liboctave/array/fCMatrix.cc, liboctave/array/fCRowVector.cc, liboctave/array/fColVector.cc, liboctave/array/fDiagMatrix.cc, liboctave/array/fMatrix.cc, liboctave/array/fRowVector.cc, liboctave/array/idx-vector.cc, liboctave/array/intNDArray.cc, liboctave/numeric/CmplxCHOL.cc, liboctave/numeric/CmplxLU.cc, liboctave/numeric/CmplxQR.cc, liboctave/numeric/DASPK.cc, liboctave/numeric/DASRT.cc, liboctave/numeric/DASSL.cc, liboctave/numeric/LSODE.cc, liboctave/numeric/ODES.cc, liboctave/numeric/ODES.h, liboctave/numeric/base-dae.h, liboctave/numeric/base-lu.cc, liboctave/numeric/dbleCHOL.cc, liboctave/numeric/dbleLU.cc, liboctave/numeric/dbleQR.cc, liboctave/numeric/eigs-base.cc, liboctave/numeric/fCmplxCHOL.cc, liboctave/numeric/fCmplxLU.cc, liboctave/numeric/fCmplxQR.cc, liboctave/numeric/floatCHOL.cc, liboctave/numeric/floatLU.cc, liboctave/numeric/floatQR.cc, liboctave/numeric/lo-specfun.cc, liboctave/numeric/oct-rand.cc, liboctave/numeric/oct-spparms.cc, liboctave/numeric/sparse-base-chol.cc, liboctave/operators/mx-inlines.cc, liboctave/system/file-ops.cc, liboctave/util/glob-match.h, liboctave/util/kpse.cc, liboctave/util/lo-regexp.cc, liboctave/util/oct-glob.cc, liboctave/util/pathsearch.cc, liboctave/util/str-vec.cc, liboctave/util/str-vec.h, liboctave/util/url-transfer.cc: replace all usage of Array::length() and Sparse::length() with ::numel(). diff -r 83792dd9bcc1 -r a9574e3c6e9e build-aux/mk-opts.pl --- a/build-aux/mk-opts.pl Tue May 26 21:07:42 2015 -0700 +++ b/build-aux/mk-opts.pl Sat May 30 03:14:07 2015 +0100 @@ -676,14 +676,14 @@ $elt_type = "octave_idx_type"; } print qq| Array<$elt_type> val = $STATIC_OBJECT_NAME.$OPT[$i] ();\n\n|; - print qq| if (val.length () == 1) + print qq| if (val.numel () == 1) { os << val(0) << "\\n"; } else { os << "\\n\\n"; - octave_idx_type len = val.length (); + octave_idx_type len = val.numel (); Matrix tmp (len, 1); for (octave_idx_type i = 0; i < len; i++) tmp(i,0) = val(i); @@ -694,7 +694,7 @@ elsif ($TYPE[$i] eq "Array") { print qq| Array val = $STATIC_OBJECT_NAME.$OPT[$i] ();\n\n|; - print qq| if (val.length () == 1) + print qq| if (val.numel () == 1) { os << val(0) << "\\n"; } @@ -709,7 +709,7 @@ elsif ($TYPE[$i] eq "Array") { print qq| Array val = $STATIC_OBJECT_NAME.$OPT[$i] ();\n\n|; - print qq| if (val.length () == 1) + print qq| if (val.numel () == 1) { os << val(0) << "\\n"; } @@ -856,13 +856,13 @@ $elt_type = "octave_idx_type"; } print " Array<$elt_type> val = $STATIC_OBJECT_NAME.$OPT[$i] ();\n\n"; - print " if (val.length () == 1) + print " if (val.numel () == 1) { retval = static_cast (val(0)); } else { - octave_idx_type len = val.length (); + octave_idx_type len = val.numel (); ColumnVector tmp (len); for (octave_idx_type i = 0; i < len; i++) tmp(i) = val(i); @@ -872,7 +872,7 @@ elsif ($TYPE[$i] eq "Array") { print " Array val = $STATIC_OBJECT_NAME.$OPT[$i] ();\n\n"; - print " if (val.length () == 1) + print " if (val.numel () == 1) { retval = val(0); } @@ -884,7 +884,7 @@ elsif ($TYPE[$i] eq "Array") { print " Array val = $STATIC_OBJECT_NAME.$OPT[$i] ();\n\n"; - print " if (val.length () == 1) + print " if (val.numel () == 1) { retval = val(0); } diff -r 83792dd9bcc1 -r a9574e3c6e9e libgui/graphics/QtHandlesUtils.cc --- a/libgui/graphics/QtHandlesUtils.cc Tue May 26 21:07:42 2015 -0700 +++ b/libgui/graphics/QtHandlesUtils.cc Sat May 30 03:14:07 2015 +0100 @@ -61,7 +61,7 @@ fromStringVector (const string_vector& v) { QStringList l; - octave_idx_type n = v.length (); + octave_idx_type n = v.numel (); for (octave_idx_type i = 0; i < n; i++) l << fromStdString (v[i]); diff -r 83792dd9bcc1 -r a9574e3c6e9e libgui/src/octave-qt-link.cc --- a/libgui/src/octave-qt-link.cc Tue May 26 21:07:42 2015 -0700 +++ b/libgui/src/octave-qt-link.cc Sat May 30 03:14:07 2015 +0100 @@ -490,7 +490,7 @@ { QStringList qt_hist; - for (octave_idx_type i = 0; i < hist.length (); i++) + for (octave_idx_type i = 0; i < hist.numel (); i++) qt_hist.append (QString::fromStdString (hist[i])); emit set_history_signal (qt_hist); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/Cell.cc --- a/libinterp/corefcn/Cell.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/Cell.cc Sat May 30 03:14:07 2015 +0100 @@ -40,7 +40,7 @@ Cell::Cell (const string_vector& sv, bool trim) : Array () { - octave_idx_type n = sv.length (); + octave_idx_type n = sv.numel (); if (n > 0) { @@ -99,7 +99,7 @@ Cell::Cell (const dim_vector& dv, const string_vector& sv, bool trim) : Array (dv, Matrix ()) { - octave_idx_type n = sv.length (); + octave_idx_type n = sv.numel (); if (n > 0) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/__contourc__.cc --- a/libinterp/corefcn/__contourc__.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/__contourc__.cc Sat May 30 03:14:07 2015 +0100 @@ -316,7 +316,7 @@ { contourc.resize (2, 0); - for (int i = 0; i < L.length (); i++) + for (int i = 0; i < L.numel (); i++) cntr (X, Y, Z, L (i)); end_contour (); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/__pchip_deriv__.cc --- a/libinterp/corefcn/__pchip_deriv__.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/__pchip_deriv__.cc Sat May 30 03:14:07 2015 +0100 @@ -68,7 +68,7 @@ FloatColumnVector xvec (args(0).float_vector_value ()); FloatMatrix ymat (args(1).float_matrix_value ()); - octave_idx_type nx = xvec.length (); + octave_idx_type nx = xvec.numel (); if (nx < 2) { @@ -115,7 +115,7 @@ ColumnVector xvec (args(0).vector_value ()); Matrix ymat (args(1).matrix_value ()); - octave_idx_type nx = xvec.length (); + octave_idx_type nx = xvec.numel (); if (nx < 2) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/__qp__.cc --- a/libinterp/corefcn/__qp__.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/__qp__.cc Sat May 30 03:14:07 2015 +0100 @@ -62,7 +62,7 @@ double tol = tmp * s(0) * std::numeric_limits::epsilon (); - octave_idx_type n = s.length (); + octave_idx_type n = s.numel (); for (octave_idx_type i = 0; i < n; i++) { @@ -97,11 +97,11 @@ double rtol = sqrt (std::numeric_limits::epsilon ()); // Problem dimension. - octave_idx_type n = x.length (); + octave_idx_type n = x.numel (); // Dimension of constraints. - octave_idx_type n_eq = beq.length (); - octave_idx_type n_in = bin.length (); + octave_idx_type n_eq = beq.numel (); + octave_idx_type n_in = bin.numel (); // Filling the current active set. diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/cellfun.cc Sat May 30 03:14:07 2015 +0100 @@ -1714,7 +1714,7 @@ dim_vector& celldv, dim_vector& arraydv, Array& perm) { - int dvl = dimv.length (); + int dvl = dimv.numel (); int maxd = dv.length (); celldv = dv; for (int i = 0; i < dvl; i++) @@ -1981,7 +1981,7 @@ for (int i = 0; i < nd; i++) { octave_idx_type s = 0; - for (octave_idx_type j = 0; j < d[i].length (); j++) + for (octave_idx_type j = 0; j < d[i].numel (); j++) s += d[i](j); octave_idx_type r = i < dv.length () ? dv(i) : 1; @@ -2031,8 +2031,8 @@ if (mat2cell_mismatch (a.dims (), d, nd)) return retval; - octave_idx_type nridx = d[0].length (); - octave_idx_type ncidx = nd == 1 ? 1 : d[1].length (); + octave_idx_type nridx = d[0].numel (); + octave_idx_type ncidx = nd == 1 ? 1 : d[1].numel (); retval.clear (nridx, ncidx); int ivec = -1; @@ -2092,7 +2092,7 @@ octave_idx_type idxtot = 0; for (int i = 0; i < nd; i++) { - rdv(i) = nidx[i] = d[i].length (); + rdv(i) = nidx[i] = d[i].numel (); idxtot += nidx[i]; } @@ -2156,7 +2156,7 @@ octave_idx_type idxtot = 0; for (int i = 0; i < nd; i++) { - rdv(i) = nidx[i] = d[i].length (); + rdv(i) = nidx[i] = d[i].numel (); idxtot += nidx[i]; } @@ -2339,7 +2339,7 @@ const Array& ub, int dim = -1) { - octave_idx_type n = lb.length (); + octave_idx_type n = lb.numel (); Cell retval (1, n); if (array.is_vector () && (dim == -1 || (dim == 0 && array.columns () == 1) @@ -2409,7 +2409,7 @@ if (! error_state) { - if (lb.length () != ub.length ()) + if (lb.numel () != ub.numel ()) error ("cellslices: the lengths of LB and UB must match"); else { @@ -2472,7 +2472,7 @@ else { // generic code. - octave_idx_type n = lb.length (); + octave_idx_type n = lb.numel (); retcell = Cell (1, n); const dim_vector dv = x.dims (); int ndims = dv.length (); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/daspk.cc --- a/libinterp/corefcn/daspk.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/daspk.cc Sat May 30 03:14:07 2015 +0100 @@ -95,7 +95,7 @@ if (tlen > 1) ires = tmp(1).int_value (); - if (error_state || retval.length () == 0) + if (error_state || retval.numel () == 0) gripe_user_supplied_eval ("daspk"); } else @@ -141,7 +141,7 @@ retval = tmp(0).matrix_value (); - if (error_state || retval.length () == 0) + if (error_state || retval.numel () == 0) gripe_user_supplied_eval ("daspk"); } else @@ -297,9 +297,9 @@ if (f_arg.is_cell ()) { Cell c = f_arg.cell_value (); - if (c.length () == 1) + if (c.numel () == 1) f_arg = c(0); - else if (c.length () == 2) + else if (c.numel () == 2) { if (c(0).is_function_handle () || c(0).is_inline_function ()) daspk_fcn = c(0).function_value (); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/dasrt.cc --- a/libinterp/corefcn/dasrt.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/dasrt.cc Sat May 30 03:14:07 2015 +0100 @@ -91,7 +91,7 @@ retval = ColumnVector (tmp(0).vector_value ()); - if (error_state || retval.length () == 0) + if (error_state || retval.numel () == 0) gripe_user_supplied_eval ("dasrt"); } else @@ -131,7 +131,7 @@ retval = ColumnVector (tmp(0).vector_value ()); - if (error_state || retval.length () == 0) + if (error_state || retval.numel () == 0) gripe_user_supplied_eval ("dasrt"); } else @@ -177,7 +177,7 @@ retval = tmp(0).matrix_value (); - if (error_state || retval.length () == 0) + if (error_state || retval.numel () == 0) gripe_user_supplied_eval ("dasrt"); } else @@ -385,9 +385,9 @@ if (f_arg.is_cell ()) { Cell c = f_arg.cell_value (); - if (c.length () == 1) + if (c.numel () == 1) f_arg = c(0); - else if (c.length () == 2) + else if (c.numel () == 2) { if (c(0).is_function_handle () || c(0).is_inline_function ()) dasrt_f = c(0).function_value (); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/dassl.cc --- a/libinterp/corefcn/dassl.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/dassl.cc Sat May 30 03:14:07 2015 +0100 @@ -95,7 +95,7 @@ if (tlen > 1) ires = tmp(1).int_value (); - if (error_state || retval.length () == 0) + if (error_state || retval.numel () == 0) gripe_user_supplied_eval ("dassl"); } else @@ -141,7 +141,7 @@ retval = tmp(0).matrix_value (); - if (error_state || retval.length () == 0) + if (error_state || retval.numel () == 0) gripe_user_supplied_eval ("dassl"); } else @@ -298,9 +298,9 @@ if (f_arg.is_cell ()) { Cell c = f_arg.cell_value (); - if (c.length () == 1) + if (c.numel () == 1) f_arg = c(0); - else if (c.length () == 2) + else if (c.numel () == 2) { if (c(0).is_function_handle () || c(0).is_inline_function ()) dassl_fcn = c(0).function_value (); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/data.cc Sat May 30 03:14:07 2015 +0100 @@ -2583,7 +2583,7 @@ // FIXME: maybe we should create an idx_vector object // here and pass that to permute? - int n = vec.length (); + int n = vec.numel (); for (int i = 0; i < n; i++) vec(i)--; @@ -5262,7 +5262,7 @@ else { CVT lv = octave_value_extract (limit); - CVT bv (lv.length (), bs); + CVT bv (lv.numel (), bs); retval = linspace (bv, lv, n); } } @@ -5272,7 +5272,7 @@ if (limit.is_scalar_type ()) { T ls = octave_value_extract (limit); - CVT lv (bv.length (), ls); + CVT lv (bv.numel (), ls); retval = linspace (bv, lv, n); } else @@ -5432,7 +5432,7 @@ if (nargin == 2) { Array vec = args(1).vector_value (); - int ndim = vec.length (); + int ndim = vec.numel (); if (ndim == 1) { octave_idx_type m = static_cast (vec(0)); @@ -5513,15 +5513,15 @@ { Array new_size = args(1).octave_idx_type_vector_value (); - if (new_size.length () < 2) + if (new_size.numel () < 2) { error ("reshape: SIZE must have 2 or more dimensions"); return retval; } - new_dims = dim_vector::alloc (new_size.length ()); - - for (octave_idx_type i = 0; i < new_size.length (); i++) + new_dims = dim_vector::alloc (new_size.numel ()); + + for (octave_idx_type i = 0; i < new_size.numel (); i++) { if (new_size(i) < 0) { @@ -8126,8 +8126,8 @@ if (! error_state) { - dims = dim_vector::alloc (size.length ()); - for (octave_idx_type i = 0; i < size.length (); i++) + dims = dim_vector::alloc (size.numel ()); + for (octave_idx_type i = 0; i < size.numel (); i++) dims(i) = size(i); } } diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/filter.cc --- a/libinterp/corefcn/filter.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/filter.cc Sat May 30 03:14:07 2015 +0100 @@ -60,8 +60,8 @@ { MArray y; - octave_idx_type a_len = a.length (); - octave_idx_type b_len = b.length (); + octave_idx_type a_len = a.numel (); + octave_idx_type b_len = b.numel (); octave_idx_type ab_len = a_len > b_len ? a_len : b_len; @@ -275,8 +275,8 @@ return MArray (); } - octave_idx_type a_len = a.length (); - octave_idx_type b_len = b.length (); + octave_idx_type a_len = a.numel (); + octave_idx_type b_len = b.numel (); octave_idx_type si_len = (a_len > b_len ? a_len : b_len) - 1; dim_vector si_dims = x.dims (); @@ -451,8 +451,8 @@ if (nargin == 3 || args(3).is_empty ()) { - octave_idx_type a_len = a.length (); - octave_idx_type b_len = b.length (); + octave_idx_type a_len = a.numel (); + octave_idx_type b_len = b.numel (); octave_idx_type si_len = (a_len > b_len ? a_len : b_len) - 1; @@ -499,8 +499,8 @@ if (nargin == 3 || args(3).is_empty ()) { - octave_idx_type a_len = a.length (); - octave_idx_type b_len = b.length (); + octave_idx_type a_len = a.numel (); + octave_idx_type b_len = b.numel (); octave_idx_type si_len = (a_len > b_len ? a_len : b_len) - 1; @@ -550,8 +550,8 @@ if (nargin == 3 || args(3).is_empty ()) { - octave_idx_type a_len = a.length (); - octave_idx_type b_len = b.length (); + octave_idx_type a_len = a.numel (); + octave_idx_type b_len = b.numel (); octave_idx_type si_len = (a_len > b_len ? a_len : b_len) - 1; @@ -598,8 +598,8 @@ if (nargin == 3 || args(3).is_empty ()) { - octave_idx_type a_len = a.length (); - octave_idx_type b_len = b.length (); + octave_idx_type a_len = a.numel (); + octave_idx_type b_len = b.numel (); octave_idx_type si_len = (a_len > b_len ? a_len : b_len) - 1; diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/find.cc --- a/libinterp/corefcn/find.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/find.cc Sat May 30 03:14:07 2015 +0100 @@ -61,7 +61,7 @@ case 2: { Array jdx (idx.dims ()); - octave_idx_type n = idx.length (); + octave_idx_type n = idx.numel (); octave_idx_type nr = nda.rows (); for (octave_idx_type i = 0; i < n; i++) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/gl-render.cc --- a/libinterp/corefcn/gl-render.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/gl-render.cc Sat May 30 03:14:07 2015 +0100 @@ -667,7 +667,7 @@ // Clear background - if (c.length () >= 3) + if (c.numel () >= 3) { glClearColor (c(0), c(1), c(2), 1); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/gl-render.h --- a/libinterp/corefcn/gl-render.h Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/gl-render.h Sat May 30 03:14:07 2015 +0100 @@ -71,7 +71,7 @@ virtual void draw (const Matrix& hlist, bool toplevel = false) { - int len = hlist.length (); + int len = hlist.numel (); for (int i = len-1; i >= 0; i--) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/graphics.cc Sat May 30 03:14:07 2015 +0100 @@ -9566,7 +9566,7 @@ fcn = c(0).function_value (); if (! error_state) { - for (int i = 1; i < c.length () ; i++) + for (int i = 1; i < c.numel () ; i++) args(1+i) = c(i); } } @@ -9865,7 +9865,7 @@ if (! error_state) { // loop over graphics objects - for (octave_idx_type n = 0; n < hcv.length (); n++) + for (octave_idx_type n = 0; n < hcv.numel (); n++) gh_manager::get_object (hcv(n)).reset_default_properties (); if (! error_state) @@ -10080,7 +10080,7 @@ bool request_drawnow = false; // loop over graphics objects - for (octave_idx_type n = 0; n < hcv.length (); n++) + for (octave_idx_type n = 0; n < hcv.numel (); n++) { graphics_object obj = gh_manager::get_object (hcv(n)); @@ -10094,7 +10094,7 @@ obj.set (args(1).cellstr_value (), args(2).cell_value (), 0); } - else if (hcv.length () == args(2).cell_value ().rows ()) + else if (hcv.numel () == args(2).cell_value ().rows ()) { obj.set (args(1).cellstr_value (), args(2).cell_value (), n); @@ -10102,7 +10102,7 @@ else { error ("set: number of graphics handles must match number of value rows (%d != %d)", - hcv.length (), args(2).cell_value ().rows ()); + hcv.numel (), args(2).cell_value ().rows ()); break; } @@ -10232,7 +10232,7 @@ if (! error_state) { - octave_idx_type len = hcv.length (); + octave_idx_type len = hcv.numel (); if (nargin == 1 && len > 1) { @@ -10396,7 +10396,7 @@ if (! error_state) { - octave_idx_type len = hcv.length (); + octave_idx_type len = hcv.numel (); vals.resize (dim_vector (len, 1)); @@ -10630,7 +10630,7 @@ { Matrix kids = go.get_properties ().get_children (); - for (octave_idx_type i = 0; i < kids.length (); i++) + for (octave_idx_type i = 0; i < kids.numel (); i++) { graphics_handle hnd = gh_manager::lookup (kids(i)); @@ -11197,7 +11197,7 @@ { Matrix hlist = gh_manager::figure_handle_list (true); - for (int i = 0; ! error_state && i < hlist.length (); i++) + for (int i = 0; ! error_state && i < hlist.numel (); i++) { graphics_handle h = gh_manager::lookup (hlist(i)); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/graphics.in.h --- a/libinterp/corefcn/graphics.in.h Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/graphics.in.h Sat May 30 03:14:07 2015 +0100 @@ -536,10 +536,10 @@ { std::string s; - for (octave_idx_type i = 0; i < str.length (); i++) + for (octave_idx_type i = 0; i < str.numel (); i++) { s += str[i]; - if (i != str.length () - 1) + if (i != str.numel () - 1) s += separator; } @@ -636,9 +636,9 @@ string_vector strings = new_cell.cellstr_value (); - octave_idx_type nel = strings.length (); - - if (nel != str.length ()) + octave_idx_type nel = strings.numel (); + + if (nel != str.numel ()) replace = true; else { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/help.cc Sat May 30 03:14:07 2015 +0100 @@ -797,22 +797,22 @@ string_vector make_name_list (void) { - const int key_len = keyword_names.length (); + const int key_len = keyword_names.numel (); const string_vector bif = symbol_table::built_in_function_names (); - const int bif_len = bif.length (); + const int bif_len = bif.numel (); const string_vector cfl = symbol_table::cmdline_function_names (); - const int cfl_len = cfl.length (); + const int cfl_len = cfl.numel (); const string_vector lcl = symbol_table::variable_names (); - const int lcl_len = lcl.length (); + const int lcl_len = lcl.numel (); const string_vector ffl = load_path::fcn_names (); - const int ffl_len = ffl.length (); + const int ffl_len = ffl.numel (); const string_vector afl = autoloaded_functions (); - const int afl_len = afl.length (); + const int afl_len = afl.numel (); const int total_len = key_len + bif_len + cfl_len + lcl_len + ffl_len + afl_len; @@ -1303,7 +1303,7 @@ if (! error_state) { - int argc = argv.length (); + int argc = argv.numel (); if (argc > 1) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/hex2num.cc --- a/libinterp/corefcn/hex2num.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/hex2num.cc Sat May 30 03:14:07 2015 +0100 @@ -242,7 +242,7 @@ if (! error_state) { octave_idx_type nchars = 8; - octave_idx_type nr = v.length (); + octave_idx_type nr = v.numel (); charMatrix m (nr, nchars); const float *pv = v.fortran_vec (); @@ -279,7 +279,7 @@ if (! error_state) { octave_idx_type nchars = 16; - octave_idx_type nr = v.length (); + octave_idx_type nr = v.numel (); charMatrix m (nr, nchars); const double *pv = v.fortran_vec (); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/input.cc --- a/libinterp/corefcn/input.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/input.cc Sat May 30 03:14:07 2015 +0100 @@ -408,13 +408,13 @@ else name_list = generate_possible_completions (text, prefix, hint); - name_list_len = name_list.length (); + name_list_len = name_list.numel (); file_name_list = command_editor::generate_filename_completions (text); name_list.append (file_name_list); - name_list_total_len = name_list.length (); + name_list_total_len = name_list.numel (); hint_len = hint.length (); @@ -1098,7 +1098,7 @@ // because it will be easier for Emacs if the names // appear in a single column. - int len = list.length (); + int len = list.numel (); for (int i = 0; i < len; i++) octave_stdout << list[i] << "\n"; diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/load-path.cc Sat May 30 03:14:07 2015 +0100 @@ -180,7 +180,7 @@ { string_vector flist = dir.read (); - octave_idx_type len = flist.length (); + octave_idx_type len = flist.numel (); all_files.resize (len); fcn_files.resize (len); @@ -250,7 +250,7 @@ { string_vector flist = dir.read (); - octave_idx_type len = flist.length (); + octave_idx_type len = flist.numel (); for (octave_idx_type i = 0; i < len; i++) { @@ -408,7 +408,7 @@ load_path::loader::move_fcn_map (const std::string& dir_name, const string_vector& fcn_files, bool at_end) { - octave_idx_type len = fcn_files.length (); + octave_idx_type len = fcn_files.numel (); for (octave_idx_type k = 0; k < len; k++) { @@ -803,7 +803,7 @@ load_path::loader::remove_fcn_map (const std::string& dir, const string_vector& fcn_files) { - octave_idx_type len = fcn_files.length (); + octave_idx_type len = fcn_files.numel (); for (octave_idx_type k = 0; k < len; k++) { @@ -1373,7 +1373,7 @@ { string_vector all_files = p->all_files; - octave_idx_type len = all_files.length (); + octave_idx_type len = all_files.numel (); for (octave_idx_type i = 0; i < len; i++) { @@ -1488,7 +1488,7 @@ std::string dir_name; std::string file_name; - octave_idx_type flen = flist.length (); + octave_idx_type flen = flist.numel (); octave_idx_type rel_flen = 0; string_vector rel_flist (flen); @@ -1534,7 +1534,7 @@ { string_vector all_files = p->all_files; - octave_idx_type len = all_files.length (); + octave_idx_type len = all_files.numel (); for (octave_idx_type i = 0; i < len; i++) { @@ -1567,7 +1567,7 @@ std::string dir_name; std::string file_name; - octave_idx_type flen = flist.length (); + octave_idx_type flen = flist.numel (); octave_idx_type rel_flen = 0; string_vector rel_flist (flen); @@ -1612,7 +1612,7 @@ { string_vector all_files = p->all_files; - octave_idx_type len = all_files.length (); + octave_idx_type len = all_files.numel (); for (octave_idx_type i = 0; i < len; i++) { @@ -1670,7 +1670,7 @@ if (omit_exts) { - octave_idx_type len = retval.length (); + octave_idx_type len = retval.numel (); for (octave_idx_type i = 0; i < len; i++) { @@ -1716,7 +1716,7 @@ string_vector xdirs = load_path::dirs (); - octave_idx_type len = xdirs.length (); + octave_idx_type len = xdirs.numel (); if (len > 0) xpath = xdirs[0]; @@ -1893,7 +1893,7 @@ string_vector fcn_files = di.fcn_files; - octave_idx_type len = fcn_files.length (); + octave_idx_type len = fcn_files.numel (); for (octave_idx_type i = 0; i < len; i++) { @@ -2150,7 +2150,7 @@ string_vector dirlist = dir.read ().sort (false); - octave_idx_type len = dirlist.length (); + octave_idx_type len = dirlist.numel (); for (octave_idx_type i = 0; i < len; i++) { @@ -2161,7 +2161,7 @@ if (! skip_p) { - for (octave_idx_type j = 0; j < skip.length (); j++) + for (octave_idx_type j = 0; j < skip.numel (); j++) { skip_p = (elt == skip[j]); if (skip_p) diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/load-save.cc --- a/libinterp/corefcn/load-save.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/load-save.cc Sat May 30 03:14:07 2015 +0100 @@ -1052,7 +1052,7 @@ bool &save_as_floats, bool &use_zlib) { string_vector retval; - int argc = argv.length (); + int argc = argv.numel (); bool do_double = false; bool do_tabs = false; @@ -1634,7 +1634,7 @@ // override from command line argv = parse_save_options (argv, format, append, save_as_floats, use_zlib); - int argc = argv.length (); + int argc = argv.numel (); int i = 0; if (error_state) diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/ls-oct-ascii.h --- a/libinterp/corefcn/ls-oct-ascii.h Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/ls-oct-ascii.h Sat May 30 03:14:07 2015 +0100 @@ -158,7 +158,7 @@ std::string tmp = buf.str (); - for (int i = 0; i < keywords.length (); i++) + for (int i = 0; i < keywords.numel (); i++) { int match = (tmp == keywords[i]); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/lsode.cc --- a/libinterp/corefcn/lsode.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/lsode.cc Sat May 30 03:14:07 2015 +0100 @@ -88,7 +88,7 @@ retval = ColumnVector (tmp(0).vector_value ()); - if (error_state || retval.length () == 0) + if (error_state || retval.numel () == 0) gripe_user_supplied_eval ("lsode"); } else @@ -127,7 +127,7 @@ retval = tmp(0).matrix_value (); - if (error_state || retval.length () == 0) + if (error_state || retval.numel () == 0) gripe_user_supplied_eval ("lsode"); } else @@ -300,9 +300,9 @@ if (f_arg.is_cell ()) { Cell c = f_arg.cell_value (); - if (c.length () == 1) + if (c.numel () == 1) f_arg = c(0); - else if (c.length () == 2) + else if (c.numel () == 2) { if (c(0).is_function_handle () || c(0).is_inline_function ()) lsode_fcn = c(0).function_value (); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/matrix_type.cc --- a/libinterp/corefcn/matrix_type.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/matrix_type.cc Sat May 30 03:14:07 2015 +0100 @@ -292,7 +292,7 @@ error ("matrix_type: Invalid permutation vector PERM"); else { - octave_idx_type len = perm.length (); + octave_idx_type len = perm.numel (); dim_vector dv = args(0).dims (); if (len != dv(0)) @@ -465,7 +465,7 @@ error ("matrix_type: Invalid permutation vector PERM"); else { - octave_idx_type len = perm.length (); + octave_idx_type len = perm.numel (); dim_vector dv = args(0).dims (); if (len != dv(0)) diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/oct-hist.cc --- a/libinterp/corefcn/oct-hist.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/oct-hist.cc Sat May 30 03:14:07 2015 +0100 @@ -250,7 +250,7 @@ hlist = command_history::list (limit, numbered_output); - int len = hlist.length (); + int len = hlist.numel (); if (nargout == 0) { @@ -360,7 +360,7 @@ string_vector hlist = command_history::list (); - int hist_count = hlist.length () - 1; // switch to zero-based indexing + int hist_count = hlist.numel () - 1; // switch to zero-based indexing // The current command line is already part of the history list by // the time we get to this point. Delete the cmd from the list when diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/oct-map.cc --- a/libinterp/corefcn/oct-map.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/oct-map.cc Sat May 30 03:14:07 2015 +0100 @@ -142,7 +142,7 @@ Array& perm) const { octave_idx_type n = nfields (); - if (perm.length () != n) + if (perm.numel () != n) perm.clear (1, n); return equal_up_to_order (other, perm.fortran_vec ()); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/oct-map.h --- a/libinterp/corefcn/oct-map.h Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/oct-map.h Sat May 30 03:14:07 2015 +0100 @@ -161,7 +161,7 @@ octave_scalar_map (void) : xkeys (), xvals () { } octave_scalar_map (const string_vector& k) - : xkeys (k), xvals (k.length ()) { } + : xkeys (k), xvals (k.numel ()) { } octave_scalar_map (const octave_scalar_map& m) : xkeys (m.xkeys), xvals(m.xvals) { } @@ -277,10 +277,10 @@ octave_map (const dim_vector& dv) : xkeys (), xvals (), dimensions (dv) { } octave_map (const string_vector& k) - : xkeys (k), xvals (k.length (), Cell (1, 1)), dimensions (1, 1) { } + : xkeys (k), xvals (k.numel (), Cell (1, 1)), dimensions (1, 1) { } octave_map (const dim_vector& dv, const string_vector& k) - : xkeys (k), xvals (k.length (), Cell (dv)), dimensions (dv) { } + : xkeys (k), xvals (k.numel (), Cell (dv)), dimensions (dv) { } octave_map (const octave_map& m) : xkeys (m.xkeys), xvals (m.xvals), dimensions (m.dimensions) { } diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/oct-obj.h --- a/libinterp/corefcn/oct-obj.h Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/oct-obj.h Sat May 30 03:14:07 2015 +0100 @@ -86,7 +86,7 @@ const octave_value& operator () (octave_idx_type n) const { return elem (n); } - octave_idx_type length (void) const { return data.length (); } + octave_idx_type length (void) const { return data.numel (); } bool empty (void) const { return length () == 0; } @@ -113,9 +113,9 @@ octave_value_list retval = data.linear_slice (offset, std::min (offset + len, length ())); - if (tags && len > 0 && names.length () > 0) + if (tags && len > 0 && names.numel () > 0) retval.names = names.linear_slice (offset, std::min (offset + len, - names.length ())); + names.numel ())); return retval; } diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/oct-stream.cc Sat May 30 03:14:07 2015 +0100 @@ -123,7 +123,7 @@ double dnr = -1.0; double dnc = -1.0; - octave_idx_type sz_len = size.length (); + octave_idx_type sz_len = size.numel (); if (sz_len == 1) { @@ -235,7 +235,7 @@ scanf_format_list::~scanf_format_list (void) { - octave_idx_type n = list.length (); + octave_idx_type n = list.numel (); for (octave_idx_type i = 0; i < n; i++) { @@ -259,7 +259,7 @@ = new scanf_format_elt (text.c_str (), width, discard, type, modifier, char_class); - if (num_elts == list.length ()) + if (num_elts == list.numel ()) list.resize (dim_vector (2 * num_elts, 1)); list(num_elts++) = elt; @@ -489,7 +489,7 @@ void scanf_format_list::printme (void) const { - octave_idx_type n = list.length (); + octave_idx_type n = list.numel (); for (octave_idx_type i = 0; i < n; i++) { @@ -517,7 +517,7 @@ bool scanf_format_list::all_character_conversions (void) { - octave_idx_type n = list.length (); + octave_idx_type n = list.numel (); if (n > 0) { @@ -547,7 +547,7 @@ bool scanf_format_list::all_numeric_conversions (void) { - octave_idx_type n = list.length (); + octave_idx_type n = list.numel (); if (n > 0) { @@ -664,7 +664,7 @@ printf_format_list::~printf_format_list (void) { - octave_idx_type n = list.length (); + octave_idx_type n = list.numel (); for (octave_idx_type i = 0; i < n; i++) { @@ -688,7 +688,7 @@ = new printf_format_elt (text.c_str (), args, fw, prec, flags, type, modifier); - if (num_elts == list.length ()) + if (num_elts == list.numel ()) list.resize (dim_vector (2 * num_elts, 1)); list(num_elts++) = elt; @@ -871,7 +871,7 @@ void printf_format_list::printme (void) const { - int n = list.length (); + int n = list.numel (); for (int i = 0; i < n; i++) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/oct-stream.h --- a/libinterp/corefcn/oct-stream.h Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/oct-stream.h Sat May 30 03:14:07 2015 +0100 @@ -116,7 +116,7 @@ // the list is 3 because of the characters that appear after the // last conversion. - octave_idx_type length (void) { return list.length (); } + octave_idx_type length (void) { return list.numel (); } const scanf_format_elt *first (void) { @@ -125,13 +125,13 @@ } const scanf_format_elt *current (void) const - { return list.length () > 0 ? list.elem (curr_idx) : 0; } + { return list.numel () > 0 ? list.elem (curr_idx) : 0; } const scanf_format_elt *next (bool cycle = true) { curr_idx++; - if (curr_idx >= list.length ()) + if (curr_idx >= list.numel ()) { if (cycle) curr_idx = 0; @@ -260,13 +260,13 @@ } const printf_format_elt *current (void) const - { return list.length () > 0 ? list.elem (curr_idx) : 0; } + { return list.numel () > 0 ? list.elem (curr_idx) : 0; } const printf_format_elt *next (bool cycle = true) { curr_idx++; - if (curr_idx >= list.length ()) + if (curr_idx >= list.numel ()) { if (cycle) curr_idx = 0; @@ -277,7 +277,7 @@ return current (); } - bool last_elt_p (void) { return (curr_idx + 1 == list.length ()); } + bool last_elt_p (void) { return (curr_idx + 1 == list.numel ()); } void printme (void) const; diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/pr-output.cc --- a/libinterp/corefcn/pr-output.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/pr-output.cc Sat May 30 03:14:07 2015 +0100 @@ -2886,7 +2886,7 @@ if (nda.is_empty ()) print_empty_nd_array (os, nda.dims (), pr_as_read_syntax); - else if (nda.length () == 1) + else if (nda.numel () == 1) { os << nda(0); } @@ -3155,7 +3155,7 @@ if (nda.is_empty ()) print_empty_nd_array (os, nda.dims (), pr_as_read_syntax); - else if (nda.length () == 1) + else if (nda.numel () == 1) octave_print_internal_template (os, nda(0), pr_as_read_syntax); else if (plus_format && ! pr_as_read_syntax) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/quadcc.cc --- a/libinterp/corefcn/quadcc.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/quadcc.cc Sat May 30 03:14:07 2015 +0100 @@ -1713,7 +1713,7 @@ return retval; } Matrix effex = fvals(0).matrix_value (); - if (effex.length () != ex.length ()) + if (effex.numel () != ex.numel ()) { error ("quadcc: integrand F must return a single, real-valued vector of the same size as the input"); return retval; @@ -1832,12 +1832,12 @@ return retval; } Matrix effex = fvals(0).matrix_value (); - if (effex.length () != ex.length ()) + if (effex.numel () != ex.numel ()) { error ("quadcc: integrand F must return a single, real-valued vector of the same size as the input"); return retval; } - neval += effex.length (); + neval += effex.numel (); for (i = 0; i < n[d] / 2; i++) { j = (2 * i + 1) * skip[d]; @@ -1980,12 +1980,12 @@ return retval; } Matrix effex = fvals(0).matrix_value (); - if (effex.length () != ex.length ()) + if (effex.numel () != ex.numel ()) { error ("quadcc: integrand F must return a single, real-valued vector of the same size as the input"); return retval; } - neval += effex.length (); + neval += effex.numel (); for (i = 0; i < n[0] - 1; i++) { j = (i + 1) * skip[0]; @@ -2076,12 +2076,12 @@ return retval; } Matrix effex = fvals(0).matrix_value (); - if (effex.length () != ex.length ()) + if (effex.numel () != ex.numel ()) { error ("quadcc: integrand F must return a single, real-valued vector of the same size as the input"); return retval; } - neval += effex.length (); + neval += effex.numel (); for (i = 0; i < n[0] - 1; i++) { j = (i + 1) * skip[0]; diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/rand.cc --- a/libinterp/corefcn/rand.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/rand.cc Sat May 30 03:14:07 2015 +0100 @@ -218,7 +218,7 @@ if (! error_state) { - octave_idx_type len = iv.length (); + octave_idx_type len = iv.numel (); dims.resize (len); @@ -317,7 +317,7 @@ { if (additional_arg) { - if (a.length () == 1) + if (a.numel () == 1) return octave_rand::float_nd_array (dims, a(0)); else { @@ -326,7 +326,7 @@ error ("%s: mismatch in argument size", fcn); return retval; } - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); FloatNDArray m (dims); float *v = m.fortran_vec (); for (octave_idx_type i = 0; i < len; i++) @@ -341,7 +341,7 @@ { if (additional_arg) { - if (a.length () == 1) + if (a.numel () == 1) return octave_rand::nd_array (dims, a(0)); else { @@ -350,7 +350,7 @@ error ("%s: mismatch in argument size", fcn); return retval; } - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); NDArray m (dims); double *v = m.fortran_vec (); for (octave_idx_type i = 0; i < len; i++) diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/regexp.cc --- a/libinterp/corefcn/regexp.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/regexp.cc Sat May 30 03:14:07 2015 +0100 @@ -368,14 +368,14 @@ { string_vector named_tokens = rx_lst.begin ()->named_tokens (); - for (int j = 0; j < named_pats.length (); j++) + for (int j = 0; j < named_pats.numel (); j++) nmap.assign (named_pats(j), named_tokens(j)); retval(5) = nmap; } else { - for (int j = 0; j < named_pats.length (); j++) + for (int j = 0; j < named_pats.numel (); j++) { Cell tmp (dim_vector (1, sz)); @@ -440,7 +440,7 @@ double e = p->end (); string_vector tmp = p->tokens (); - tokens(i) = Cell (dim_vector (1, tmp.length ()), tmp); + tokens(i) = Cell (dim_vector (1, tmp.numel ()), tmp); match_string(i) = p->match_string (); token_extents(i) = p->token_extents (); end(i) = e; diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/strfns.cc --- a/libinterp/corefcn/strfns.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/strfns.cc Sat May 30 03:14:07 2015 +0100 @@ -103,8 +103,8 @@ return retval; } - if (s.length () > 0) - n_elts += s.length (); + if (s.numel () > 0) + n_elts += s.numel (); else n_elts += 1; @@ -125,7 +125,7 @@ string_vector s = args_as_strings.front (); args_as_strings.pop (); - int n = s.length (); + int n = s.numel (); if (n > 0) { @@ -224,7 +224,7 @@ return retval; } - size_t n = s.length (); + size_t n = s.numel (); // do not count empty strings in calculation of number of elements if (n > 0) @@ -253,7 +253,7 @@ string_vector s = args_as_strings.front (); args_as_strings.pop (); - size_t n = s.length (); + size_t n = s.numel (); if (n > 0) { @@ -365,7 +365,7 @@ const Cell cell = cell_val.cell_value (); const string_vector str = str_val.all_strings (); - octave_idx_type r = str.length (); + octave_idx_type r = str.numel (); if (r == 0 || r == 1) { @@ -378,13 +378,13 @@ if (cell_val.is_cellstr ()) { const Array cellstr = cell_val.cellstr_value (); - for (octave_idx_type i = 0; i < cellstr.length (); i++) + for (octave_idx_type i = 0; i < cellstr.numel (); i++) output(i) = str_op (cellstr(i), s, n); } else { // FIXME: should we warn here? - for (octave_idx_type i = 0; i < cell.length (); i++) + for (octave_idx_type i = 0; i < cell.numel (); i++) { if (cell(i).is_string ()) output(i) = str_op (cell(i).string_value (), s, n); @@ -395,7 +395,7 @@ } else if (r > 1) { - if (cell.length () == 1) + if (cell.numel () == 1) { // Broadcast the cell. @@ -418,13 +418,13 @@ boolNDArray output (cell.dims (), false); - if (cell.length () == r) + if (cell.numel () == r) { if (cell_val.is_cellstr ()) { const Array cellstr = cell_val.cellstr_value (); - for (octave_idx_type i = 0; i < cellstr.length (); i++) + for (octave_idx_type i = 0; i < cellstr.numel (); i++) output(i) = str_op (str[i], cellstr(i), n); } else @@ -484,7 +484,7 @@ if (cell1_val.is_cellstr ()) { const Array cellstr = cell1_val.cellstr_value (); - for (octave_idx_type i = 0; i < cellstr.length (); i++) + for (octave_idx_type i = 0; i < cellstr.numel (); i++) output(i) = str_op (cellstr(i), str2, n); } else diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/sub2ind.cc --- a/libinterp/corefcn/sub2ind.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/sub2ind.cc Sat May 30 03:14:07 2015 +0100 @@ -39,7 +39,7 @@ { RowVector dimsv = val.row_vector_value (false, true); dim_vector dv; - octave_idx_type n = dimsv.length (); + octave_idx_type n = dimsv.numel (); if (n < 1) error ("%s: dimension vector DIMS must not be empty", name); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/symtab.h --- a/libinterp/corefcn/symtab.h Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/symtab.h Sat May 30 03:14:07 2015 +0100 @@ -2052,7 +2052,7 @@ { std::list retval; - size_t len = patterns.length (); + size_t len = patterns.numel (); for (size_t i = 0; i < len; i++) { @@ -2069,7 +2069,7 @@ { std::list retval; - size_t len = patterns.length (); + size_t len = patterns.numel (); for (size_t i = 0; i < len; i++) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/syscalls.cc --- a/libinterp/corefcn/syscalls.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/syscalls.cc Sat May 30 03:14:07 2015 +0100 @@ -204,7 +204,7 @@ if (! error_state) { - int len = tmp.length (); + int len = tmp.numel (); exec_args.resize (len + 1); @@ -316,7 +316,7 @@ if (! error_state) { - int len = tmp.length (); + int len = tmp.numel (); arg_list.resize (len + 1); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/tsearch.cc --- a/libinterp/corefcn/tsearch.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/tsearch.cc Sat May 30 03:14:07 2015 +0100 @@ -103,7 +103,7 @@ maxy(k) = max (REF (y, k, 0), REF (y, k, 1), REF (y, k, 2)) + eps; } - const octave_idx_type np = xi.length (); + const octave_idx_type np = xi.numel (); ColumnVector values (np); double x0, y0, a11, a12, a21, a22, det; diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/urlwrite.cc --- a/libinterp/corefcn/urlwrite.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/urlwrite.cc Sat May 30 03:14:07 2015 +0100 @@ -712,7 +712,7 @@ else { string_vector sv = curl.list (); - octave_idx_type n = sv.length (); + octave_idx_type n = sv.numel (); if (n == 0) { @@ -1050,7 +1050,7 @@ glob_match pattern (file_ops::tilde_expand (pat)); string_vector files = pattern.glob (); - for (octave_idx_type i = 0; i < files.length (); i++) + for (octave_idx_type i = 0; i < files.numel (); i++) { std::string file = files (i); @@ -1145,7 +1145,7 @@ glob_match pattern (file); - for (octave_idx_type i = 0; i < sv.length (); i++) + for (octave_idx_type i = 0; i < sv.numel (); i++) { if (pattern.match (sv(i))) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/utils.cc Sat May 30 03:14:07 2015 +0100 @@ -267,7 +267,7 @@ string_vector sv = p.find_all_first_of (names); - octave_idx_type len = sv.length (); + octave_idx_type len = sv.numel (); for (octave_idx_type i = 0; i < len; i++) sv[i] = octave_env::make_absolute (sv[i]); @@ -278,7 +278,7 @@ static string_vector make_absolute (const string_vector& sv) { - octave_idx_type len = sv.length (); + octave_idx_type len = sv.numel (); string_vector retval (len); @@ -316,7 +316,7 @@ { string_vector names = args(0).all_strings (); - if (! error_state && names.length () > 0) + if (! error_state && names.numel () > 0) { if (nargin == 1) retval = @@ -399,7 +399,7 @@ string_vector names = args(1).all_strings (); - if (! error_state && names.length () > 0) + if (! error_state && names.numel () > 0) { if (nargin == 2) retval = search_path_for_file (path, names); @@ -1218,7 +1218,7 @@ if (error_state) return; - octave_idx_type n = v.length (); + octave_idx_type n = v.numel (); dim.resize (n); for (octave_idx_type i = 0; i < n; i++) dim(i) = static_cast (fix (v(i))); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/variables.cc --- a/libinterp/corefcn/variables.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/variables.cc Sat May 30 03:14:07 2015 +0100 @@ -2217,7 +2217,7 @@ { string_vector fcns = symbol_table::user_function_names (); - int fcount = fcns.length (); + int fcount = fcns.numel (); for (int i = 0; i < fcount; i++) { @@ -2243,7 +2243,7 @@ { string_vector gvars = symbol_table::global_variable_names (); - int gcount = gvars.length (); + int gcount = gvars.numel (); for (int i = 0; i < gcount; i++) symbol_table::clear_global (gvars[i]); @@ -2254,7 +2254,7 @@ { string_vector gvars = symbol_table::global_variable_names (); - int gcount = gvars.length (); + int gcount = gvars.numel (); for (int i = 0; i < gcount; i++) { @@ -2284,7 +2284,7 @@ { string_vector lvars = symbol_table::variable_names (); - int lcount = lvars.length (); + int lcount = lvars.numel (); for (int i = 0; i < lcount; i++) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/xdiv.cc --- a/libinterp/corefcn/xdiv.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/xdiv.cc Sat May 30 03:14:07 2015 +0100 @@ -289,7 +289,7 @@ { NDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result (i) = a / b (i); @@ -303,7 +303,7 @@ { ComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result (i) = a / b (i); @@ -317,7 +317,7 @@ { ComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result (i) = a / b (i); @@ -331,7 +331,7 @@ { ComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result (i) = a / b (i); @@ -590,7 +590,7 @@ { FloatNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result (i) = a / b (i); @@ -604,7 +604,7 @@ { FloatComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result (i) = a / b (i); @@ -618,7 +618,7 @@ { FloatComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result (i) = a / b (i); @@ -632,7 +632,7 @@ { FloatComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result (i) = a / b (i); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/corefcn/xpow.cc --- a/libinterp/corefcn/xpow.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/corefcn/xpow.cc Sat May 30 03:14:07 2015 +0100 @@ -1121,7 +1121,7 @@ { Complex atmp (a); ComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result(i) = std::pow (atmp, b(i)); @@ -1132,7 +1132,7 @@ else { NDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result (i) = std::pow (a, b(i)); @@ -1150,7 +1150,7 @@ { ComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result(i) = std::pow (a, b(i)); @@ -1171,7 +1171,7 @@ { ComplexNDArray result (a.dims ()); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); @@ -1185,7 +1185,7 @@ else { NDArray result (a.dims ()); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b); @@ -1201,22 +1201,22 @@ int ib = static_cast (b); if (ib == 2) { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) result(i) = a(i) * a(i); } else if (ib == 3) { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) result(i) = a(i) * a(i) * a(i); } else if (ib == -1) { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) result(i) = 1.0 / a(i); } else { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), ib); @@ -1257,7 +1257,7 @@ } } - int len = a.length (); + int len = a.numel (); bool convert_to_complex = false; @@ -1310,7 +1310,7 @@ { ComplexNDArray result (a.dims ()); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b); @@ -1341,7 +1341,7 @@ ComplexNDArray result (a_dims); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b(i)); @@ -1356,7 +1356,7 @@ { ComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); double btmp = b(i); @@ -1375,7 +1375,7 @@ { ComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result(i) = std::pow (a, b(i)); @@ -1394,12 +1394,12 @@ { if (b == -1) { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) result.xelem (i) = 1.0 / a(i); } else { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), static_cast (b)); @@ -1408,7 +1408,7 @@ } else { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b); @@ -1440,7 +1440,7 @@ ComplexNDArray result (a_dims); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); double btmp = b(i); @@ -1459,7 +1459,7 @@ { ComplexNDArray result (a.dims ()); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b); @@ -1490,7 +1490,7 @@ ComplexNDArray result (a_dims); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b(i)); @@ -2471,7 +2471,7 @@ { FloatComplex atmp (a); FloatComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result(i) = std::pow (atmp, b(i)); @@ -2482,7 +2482,7 @@ else { FloatNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result (i) = std::pow (a, b(i)); @@ -2500,7 +2500,7 @@ { FloatComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result(i) = std::pow (a, b(i)); @@ -2521,7 +2521,7 @@ { FloatComplexNDArray result (a.dims ()); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); @@ -2535,7 +2535,7 @@ else { FloatNDArray result (a.dims ()); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b); @@ -2551,22 +2551,22 @@ int ib = static_cast (b); if (ib == 2) { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) result(i) = a(i) * a(i); } else if (ib == 3) { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) result(i) = a(i) * a(i) * a(i); } else if (ib == -1) { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) result(i) = 1.0f / a(i); } else { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), ib); @@ -2607,7 +2607,7 @@ } } - int len = a.length (); + int len = a.numel (); bool convert_to_complex = false; @@ -2660,7 +2660,7 @@ { FloatComplexNDArray result (a.dims ()); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b); @@ -2691,7 +2691,7 @@ FloatComplexNDArray result (a_dims); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b(i)); @@ -2706,7 +2706,7 @@ { FloatComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); float btmp = b(i); @@ -2725,7 +2725,7 @@ { FloatComplexNDArray result (b.dims ()); - for (octave_idx_type i = 0; i < b.length (); i++) + for (octave_idx_type i = 0; i < b.numel (); i++) { octave_quit (); result(i) = std::pow (a, b(i)); @@ -2744,12 +2744,12 @@ { if (b == -1) { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) result.xelem (i) = 1.0f / a(i); } else { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), static_cast (b)); @@ -2758,7 +2758,7 @@ } else { - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b); @@ -2790,7 +2790,7 @@ FloatComplexNDArray result (a_dims); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); float btmp = b(i); @@ -2809,7 +2809,7 @@ { FloatComplexNDArray result (a.dims ()); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b); @@ -2840,7 +2840,7 @@ FloatComplexNDArray result (a_dims); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) { octave_quit (); result(i) = std::pow (a(i), b(i)); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/dldfcn/__glpk__.cc --- a/libinterp/dldfcn/__glpk__.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/dldfcn/__glpk__.cc Sat May 30 03:14:07 2015 +0100 @@ -470,7 +470,7 @@ //-- bound on each of the variables. Matrix LB (args(3).matrix_value ()); - if (error_state || LB.length () < mrowsc) + if (error_state || LB.numel () < mrowsc) { error ("__glpk__: invalid value of LB"); return retval; @@ -495,7 +495,7 @@ //-- bound on each of the variables. Matrix UB (args(4).matrix_value ()); - if (error_state || UB.length () < mrowsc) + if (error_state || UB.numel () < mrowsc) { error ("__glpk__: invalid value of UB"); return retval; diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/dldfcn/__init_fltk__.cc Sat May 30 03:14:07 2015 +0100 @@ -563,7 +563,7 @@ { std::vector delayed_menus; Matrix kids = find_uimenu_children (uimenup); - int len = kids.length (); + int len = kids.numel (); std::string fltk_label = uimenup.get_fltk_label (); int count = 0; @@ -613,7 +613,7 @@ { std::vector delayed_menus; Matrix kids = find_uimenu_children (figp); - int len = kids.length (); + int len = kids.numel (); int count = 0; menubar->clear (); for (octave_idx_type ii = 0; ii < len; ii++) @@ -658,7 +658,7 @@ Matrix kids; std::string type = prop.get_type (); kids = find_uimenu_children (prop); - int len = kids.length (); + int len = kids.numel (); for (octave_idx_type ii = 0; ii < len; ii++) { @@ -1113,7 +1113,7 @@ graphics_handle pixel2axes_or_ca (int px, int py) { Matrix kids = fp.get_children (); - int len = kids.length (); + int len = kids.numel (); for (int k = 0; k < len; k++) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/dldfcn/__magick_read__.cc --- a/libinterp/dldfcn/__magick_read__.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/dldfcn/__magick_read__.cc Sat May 30 03:14:07 2015 +0100 @@ -216,7 +216,7 @@ octave_value_list retval (3, Matrix ()); std::map region = calculate_region (options); - const octave_idx_type nFrames = frameidx.length (); + const octave_idx_type nFrames = frameidx.numel (); const octave_idx_type nRows = region["row_out"]; const octave_idx_type nCols = region["col_out"]; @@ -311,7 +311,7 @@ octave_value_list retval (3, Matrix ()); std::map region = calculate_region (options); - const octave_idx_type nFrames = frameidx.length (); + const octave_idx_type nFrames = frameidx.numel (); const octave_idx_type nRows = region["row_out"]; const octave_idx_type nCols = region["col_out"]; T img; diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/dldfcn/audiodevinfo.cc --- a/libinterp/dldfcn/audiodevinfo.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/dldfcn/audiodevinfo.cc Sat May 30 03:14:07 2015 +0100 @@ -1086,7 +1086,7 @@ unsigned int audioplayer::get_total_samples (void) { - return left.length (); + return left.numel (); } void @@ -1104,7 +1104,7 @@ void audioplayer::reset_end_sample (void) { - set_end_sample (left.length ()); + set_end_sample (left.numel ()); } void diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/dldfcn/ccolamd.cc --- a/libinterp/dldfcn/ccolamd.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/dldfcn/ccolamd.cc Sat May 30 03:14:07 2015 +0100 @@ -162,7 +162,7 @@ if (nargin > 1) { NDArray User_knobs = args(1).array_value (); - int nel_User_knobs = User_knobs.length (); + int nel_User_knobs = User_knobs.numel (); if (nel_User_knobs > 0) knobs[CCOLAMD_LU] = (User_knobs(0) != 0); @@ -273,7 +273,7 @@ if (nargin > 2) { NDArray in_cmember = args(2).array_value (); - octave_idx_type cslen = in_cmember.length (); + octave_idx_type cslen = in_cmember.numel (); OCTAVE_LOCAL_BUFFER (octave_idx_type, cmember, cslen); for (octave_idx_type i = 0; i < cslen; i++) // convert cmember from 1-based to 0-based @@ -422,7 +422,7 @@ if (nargin > 1) { NDArray User_knobs = args(1).array_value (); - int nel_User_knobs = User_knobs.length (); + int nel_User_knobs = User_knobs.numel (); if (nel_User_knobs > 0) knobs[CCOLAMD_DENSE_ROW] = User_knobs(0); @@ -511,7 +511,7 @@ if (nargin > 2) { NDArray in_cmember = args(2).array_value (); - octave_idx_type cslen = in_cmember.length (); + octave_idx_type cslen = in_cmember.numel (); OCTAVE_LOCAL_BUFFER (octave_idx_type, cmember, cslen); for (octave_idx_type i = 0; i < cslen; i++) // convert cmember from 1-based to 0-based diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/dldfcn/colamd.cc --- a/libinterp/dldfcn/colamd.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/dldfcn/colamd.cc Sat May 30 03:14:07 2015 +0100 @@ -297,7 +297,7 @@ if (nargin == 2) { NDArray User_knobs = args(1).array_value (); - int nel_User_knobs = User_knobs.length (); + int nel_User_knobs = User_knobs.numel (); if (nel_User_knobs > 0) knobs[COLAMD_DENSE_ROW] = User_knobs(0); @@ -534,7 +534,7 @@ if (nargin == 2) { NDArray User_knobs = args(1).array_value (); - int nel_User_knobs = User_knobs.length (); + int nel_User_knobs = User_knobs.numel (); if (nel_User_knobs > 0) knobs[COLAMD_DENSE_ROW] = User_knobs(COLAMD_DENSE_ROW); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/octave-value/ov-cell.cc --- a/libinterp/octave-value/ov-cell.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/octave-value/ov-cell.cc Sat May 30 03:14:07 2015 +0100 @@ -156,7 +156,7 @@ { Cell tcell = tmp.cell_value (); - if (tcell.length () == 1) + if (tcell.numel () == 1) retval(0) = tcell(0,0); else retval = octave_value (octave_value_list (tcell), true); @@ -208,7 +208,7 @@ { const Cell tcell = tmp.cell_value (); - if (tcell.length () == 1) + if (tcell.numel () == 1) retval = tcell(0,0); else retval = octave_value (octave_value_list (tcell), true); @@ -617,7 +617,7 @@ if (error_state) return retval; - octave_idx_type s_len = s.length (); + octave_idx_type s_len = s.numel (); n_elts += s_len ? s_len : 1; @@ -638,7 +638,7 @@ const string_vector s = strvec_queue.front (); strvec_queue.pop (); - octave_idx_type s_len = s.length (); + octave_idx_type s_len = s.numel (); if (s_len) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/octave-value/ov-class.cc --- a/libinterp/octave-value/ov-class.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/octave-value/ov-class.cc Sat May 30 03:14:07 2015 +0100 @@ -406,7 +406,7 @@ { Cell t = tmp.index (idx.front ()); - retval(0) = (t.length () == 1) ? t(0) + retval(0) = (t.numel () == 1) ? t(0) : octave_value (t, true); // We handled two index elements, so tell @@ -427,7 +427,7 @@ { Cell t = dotref (idx.front ()); - retval(0) = (t.length () == 1) ? t(0) : octave_value (t, true); + retval(0) = (t.numel () == 1) ? t(0) : octave_value (t, true); } } break; @@ -508,7 +508,7 @@ { octave_value retval; - if (val.length () == 1) + if (val.numel () == 1) { retval = val(0); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/octave-value/ov-class.h --- a/libinterp/octave-value/ov-class.h Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/octave-value/ov-class.h Sat May 30 03:14:07 2015 +0100 @@ -257,7 +257,7 @@ return *this; } - octave_idx_type nfields (void) const { return field_names.length (); } + octave_idx_type nfields (void) const { return field_names.numel (); } size_t nparents (void) const { return parent_class_names.size (); } diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/octave-value/ov-fcn-inline.cc --- a/libinterp/octave-value/ov-fcn-inline.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/octave-value/ov-fcn-inline.cc Sat May 30 03:14:07 2015 +0100 @@ -70,7 +70,7 @@ buf << "@("; - for (int i = 0; i < ifargs.length (); i++) + for (int i = 0; i < ifargs.numel (); i++) { if (i > 0) buf << ", "; @@ -128,12 +128,12 @@ string_vector args = fcn_arg_names (); - m.assign ("numArgs", args.length ()); + m.assign ("numArgs", args.numel ()); m.assign ("args", args); std::ostringstream buf; - for (int i = 0; i < args.length (); i++) + for (int i = 0; i < args.numel (); i++) buf << args(i) << " = INLINE_INPUTS_{" << i + 1 << "}; "; m.assign ("inputExpr", buf.str ()); @@ -144,8 +144,8 @@ bool octave_fcn_inline::save_ascii (std::ostream& os) { - os << "# nargs: " << ifargs.length () << "\n"; - for (int i = 0; i < ifargs.length (); i++) + os << "# nargs: " << ifargs.numel () << "\n"; + for (int i = 0; i < ifargs.numel (); i++) os << ifargs(i) << "\n"; if (nm.length () < 1) // Write an invalid value to flag empty fcn handle name. @@ -195,9 +195,9 @@ bool octave_fcn_inline::save_binary (std::ostream& os, bool&) { - int32_t tmp = ifargs.length (); + int32_t tmp = ifargs.numel (); os.write (reinterpret_cast (&tmp), 4); - for (int i = 0; i < ifargs.length (); i++) + for (int i = 0; i < ifargs.numel (); i++) { tmp = ifargs(i).length (); os.write (reinterpret_cast (&tmp), 4); @@ -291,7 +291,7 @@ if (group_hid < 0) return false; size_t len = 0; - for (int i = 0; i < ifargs.length (); i++) + for (int i = 0; i < ifargs.numel (); i++) if (len < ifargs(i).length ()) len = ifargs(i).length (); @@ -304,7 +304,7 @@ OCTAVE_LOCAL_BUFFER (hsize_t, hdims, 2); // Octave uses column-major, while HDF5 uses row-major ordering - hdims[1] = ifargs.length (); + hdims[1] = ifargs.numel (); hdims[0] = len + 1; space_hid = H5Screate_simple (2, hdims, 0); @@ -327,10 +327,10 @@ return false; } - OCTAVE_LOCAL_BUFFER (char, s, ifargs.length () * (len + 1)); + OCTAVE_LOCAL_BUFFER (char, s, ifargs.numel () * (len + 1)); // Save the args as a null teminated list - for (int i = 0; i < ifargs.length (); i++) + for (int i = 0; i < ifargs.numel (); i++) { const char * cptr = ifargs(i).c_str (); for (size_t j = 0; j < ifargs(i).length (); j++) @@ -627,7 +627,7 @@ else buf << nm << "("; - for (int i = 0; i < ifargs.length (); i++) + for (int i = 0; i < ifargs.numel (); i++) { if (i) buf << ", "; @@ -751,7 +751,7 @@ { bool have_arg = false; - for (int j = 0; j < fargs.length (); j++) + for (int j = 0; j < fargs.numel (); j++) if (tmp_arg == fargs (j)) { have_arg = true; @@ -773,7 +773,7 @@ // Sort the arguments into ascii order. fargs.sort (); - if (fargs.length () == 0) + if (fargs.numel () == 0) fargs.append (std::string ("x")); } @@ -920,9 +920,9 @@ { string_vector t1 = fn->fcn_arg_names (); - Cell t2 (dim_vector (t1.length (), 1)); + Cell t2 (dim_vector (t1.numel (), 1)); - for (int i = 0; i < t1.length (); i++) + for (int i = 0; i < t1.numel (); i++) t2(i) = t1(i); retval = t2; diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/octave-value/ov-java.cc --- a/libinterp/octave-value/ov-java.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/octave-value/ov-java.cc Sat May 30 03:14:07 2015 +0100 @@ -1097,7 +1097,7 @@ NDArray m (dims); mID = jni_env->GetMethodID (cls, "toDouble", "()[D"); jdoubleArray_ref dv (jni_env, reinterpret_cast (jni_env->CallObjectMethod (jobj, mID))); - jni_env->GetDoubleArrayRegion (dv, 0, m.length (), m.fortran_vec ()); + jni_env->GetDoubleArrayRegion (dv, 0, m.numel (), m.fortran_vec ()); retval = m; break; } @@ -1108,7 +1108,7 @@ uint8NDArray m (dims); mID = jni_env->GetMethodID (cls, "toByte", "()[B"); jbyteArray_ref dv (jni_env, reinterpret_cast (jni_env->CallObjectMethod (jobj, mID))); - jni_env->GetByteArrayRegion (dv, 0, m.length (), reinterpret_cast (m.fortran_vec ())); + jni_env->GetByteArrayRegion (dv, 0, m.numel (), reinterpret_cast (m.fortran_vec ())); retval = m; break; } @@ -1117,7 +1117,7 @@ int8NDArray m (dims); mID = jni_env->GetMethodID (cls, "toByte", "()[B"); jbyteArray_ref dv (jni_env, reinterpret_cast (jni_env->CallObjectMethod (jobj, mID))); - jni_env->GetByteArrayRegion (dv, 0, m.length (), reinterpret_cast (m.fortran_vec ())); + jni_env->GetByteArrayRegion (dv, 0, m.numel (), reinterpret_cast (m.fortran_vec ())); retval = m; break; } @@ -1129,7 +1129,7 @@ uint32NDArray m (dims); mID = jni_env->GetMethodID (cls, "toInt", "()[I"); jintArray_ref dv (jni_env, reinterpret_cast (jni_env->CallObjectMethod (jobj, mID))); - jni_env->GetIntArrayRegion (dv, 0, m.length (), reinterpret_cast (m.fortran_vec ())); + jni_env->GetIntArrayRegion (dv, 0, m.numel (), reinterpret_cast (m.fortran_vec ())); retval = m; break; } @@ -1138,7 +1138,7 @@ int32NDArray m (dims); mID = jni_env->GetMethodID (cls, "toInt", "()[I"); jintArray_ref dv (jni_env, reinterpret_cast (jni_env->CallObjectMethod (jobj, mID))); - jni_env->GetIntArrayRegion (dv, 0, m.length (), reinterpret_cast (m.fortran_vec ())); + jni_env->GetIntArrayRegion (dv, 0, m.numel (), reinterpret_cast (m.fortran_vec ())); retval = m; break; } @@ -1217,7 +1217,7 @@ jdoubleArray_ref row (jni_env, reinterpret_cast (jni_env->GetObjectArrayElement (jarr, r))); - if (m.length () == 0) + if (m.numel () == 0) { cols = jni_env->GetArrayLength (row); m.resize (cols, rows); @@ -1348,8 +1348,8 @@ || val.is_range ())) { Matrix m = val.matrix_value (); - jdoubleArray dv = jni_env->NewDoubleArray (m.length ()); - jni_env->SetDoubleArrayRegion (dv, 0, m.length (), m.fortran_vec ()); + jdoubleArray dv = jni_env->NewDoubleArray (m.numel ()); + jni_env->SetDoubleArrayRegion (dv, 0, m.numel (), m.fortran_vec ()); jobj = dv; jcls = jni_env->GetObjectClass (jobj); } @@ -1369,8 +1369,8 @@ if (val.is_double_type ()) { NDArray m = val.array_value (); - jdoubleArray_ref dv (jni_env, jni_env->NewDoubleArray (m.length ())); - jni_env->SetDoubleArrayRegion (jdoubleArray (dv), 0, m.length (), + jdoubleArray_ref dv (jni_env, jni_env->NewDoubleArray (m.numel ())); + jni_env->SetDoubleArrayRegion (jdoubleArray (dv), 0, m.numel (), m.fortran_vec ()); jmethodID mID = jni_env->GetMethodID (mcls, "", "([D[I)V"); jobj = jni_env->NewObject (jclass (mcls), mID, jdoubleArray (dv), @@ -1380,8 +1380,8 @@ else if (val.is_int8_type ()) { int8NDArray m = val.int8_array_value (); - jbyteArray_ref bv (jni_env, jni_env->NewByteArray (m.length ())); - jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.length (), + jbyteArray_ref bv (jni_env, jni_env->NewByteArray (m.numel ())); + jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.numel (), reinterpret_cast (m.fortran_vec ())); jmethodID mID = jni_env->GetMethodID (mcls, "", "([B[I)V"); jobj = jni_env->NewObject (jclass (mcls), mID, jbyteArray (bv), jintArray (iv)); @@ -1390,8 +1390,8 @@ else if (val.is_uint8_type ()) { uint8NDArray m = val.uint8_array_value (); - jbyteArray_ref bv (jni_env, jni_env->NewByteArray (m.length ())); - jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.length (), + jbyteArray_ref bv (jni_env, jni_env->NewByteArray (m.numel ())); + jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.numel (), reinterpret_cast (m.fortran_vec ())); jmethodID mID = jni_env->GetMethodID (mcls, "", "([B[I)V"); jobj = jni_env->NewObject (jclass (mcls), mID, jbyteArray (bv), jintArray (iv)); @@ -1400,8 +1400,8 @@ else if (val.is_int32_type ()) { int32NDArray m = val.int32_array_value (); - jintArray_ref v (jni_env, jni_env->NewIntArray (m.length ())); - jni_env->SetIntArrayRegion (jintArray (v), 0, m.length (), + jintArray_ref v (jni_env, jni_env->NewIntArray (m.numel ())); + jni_env->SetIntArrayRegion (jintArray (v), 0, m.numel (), reinterpret_cast (m.fortran_vec ())); jmethodID mID = jni_env->GetMethodID (mcls, "", "([I[I)V"); jobj = jni_env->NewObject (jclass (mcls), mID, jintArray (v), jintArray (iv)); @@ -1417,8 +1417,8 @@ { Cell cellStr = val.cell_value (); jclass_ref scls (jni_env, jni_env->FindClass ("java/lang/String")); - jobjectArray array = jni_env->NewObjectArray (cellStr.length (), scls, 0); - for (int i = 0; i < cellStr.length (); i++) + jobjectArray array = jni_env->NewObjectArray (cellStr.numel (), scls, 0); + for (int i = 0; i < cellStr.numel (); i++) { jstring_ref jstr (jni_env, jni_env->NewStringUTF (cellStr(i).string_value().c_str ())); @@ -1602,7 +1602,7 @@ Cell c = val.cell_value (); octave_function *fcn = c(0).function_value (); - for (int i=1; i pvec = matrix.col_perm_vec (); - octave_idx_type n = pvec.length (); + octave_idx_type n = pvec.numel (); ColumnVector tmp (n); for (octave_idx_type i = 0; i < n; i++) tmp(i) = pvec(i) + 1; os << tmp; diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/octave-value/ov-struct.cc --- a/libinterp/octave-value/ov-struct.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/octave-value/ov-struct.cc Sat May 30 03:14:07 2015 +0100 @@ -157,7 +157,7 @@ { const Cell t = tmp.index (idx.front ()); - retval(0) = (t.length () == 1) ? t(0) : octave_value (t, true); + retval(0) = (t.numel () == 1) ? t(0) : octave_value (t, true); // We handled two index elements, so tell // next_subsref to skip both of them. @@ -176,7 +176,7 @@ { const Cell t = dotref (idx.front ()); - retval(0) = (t.length () == 1) ? t(0) : octave_value (t, true); + retval(0) = (t.numel () == 1) ? t(0) : octave_value (t, true); } } break; @@ -223,7 +223,7 @@ { const Cell t = tmp.index (idx.front (), auto_add); - retval = (t.length () == 1) ? t(0) : octave_value (t, true); + retval = (t.numel () == 1) ? t(0) : octave_value (t, true); // We handled two index elements, so tell // next_subsref to skip both of them. @@ -242,7 +242,7 @@ { const Cell t = dotref (idx.front (), auto_add); - retval = (t.length () == 1) ? t(0) : octave_value (t, true); + retval = (t.numel () == 1) ? t(0) : octave_value (t, true); } } break; @@ -679,7 +679,7 @@ string_vector key_list = map.fieldnames (); - for (octave_idx_type i = 0; i < key_list.length (); i++) + for (octave_idx_type i = 0; i < key_list.numel (); i++) { std::string key = key_list[i]; @@ -1400,7 +1400,7 @@ string_vector key_list = map.fieldnames (); - for (octave_idx_type i = 0; i < key_list.length (); i++) + for (octave_idx_type i = 0; i < key_list.numel (); i++) { std::string key = key_list[i]; @@ -2017,7 +2017,7 @@ string_vector keys = m.fieldnames (); - if (keys.length () == 0) + if (keys.numel () == 0) retval = Cell (0, 1); else retval = Cell (keys); diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/octave-value/ov-typeinfo.cc --- a/libinterp/octave-value/ov-typeinfo.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/octave-value/ov-typeinfo.cc Sat May 30 03:14:07 2015 +0100 @@ -193,7 +193,7 @@ if (t_name == types (i)) return i; - int len = types.length (); + int len = types.numel (); if (i == len) { diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/octave-value/ov.cc --- a/libinterp/octave-value/ov.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/octave-value/ov.cc Sat May 30 03:14:07 2015 +0100 @@ -2998,7 +2998,7 @@ { Cell subs_cell = subs(k).cell_value (); - for (int n = 0; n < subs_cell.length (); n++) + for (int n = 0; n < subs_cell.numel (); n++) { if (subs_cell(n).is_string () && subs_cell(n).string_value () == ":") diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/operators/op-int.h --- a/libinterp/operators/op-int.h Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/operators/op-int.h Sat May 30 03:14:07 2015 +0100 @@ -370,7 +370,7 @@ elem_xpow (const octave_ ## T1& a, const T2 ## NDArray& b) \ { \ T2 ## NDArray result (b.dims ()); \ - for (int i = 0; i < b.length (); i++) \ + for (int i = 0; i < b.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = pow (a, b(i)); \ @@ -382,7 +382,7 @@ elem_xpow (const octave_ ## T1& a, const NDArray& b) \ { \ T1 ## NDArray result (b.dims ()); \ - for (int i = 0; i < b.length (); i++) \ + for (int i = 0; i < b.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = pow (a, b(i)); \ @@ -394,7 +394,7 @@ elem_xpow (double a, const T2 ## NDArray& b) \ { \ T2 ## NDArray result (b.dims ()); \ - for (int i = 0; i < b.length (); i++) \ + for (int i = 0; i < b.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = pow (a, b(i)); \ @@ -406,7 +406,7 @@ elem_xpow (const octave_ ## T1& a, const FloatNDArray& b) \ { \ T1 ## NDArray result (b.dims ()); \ - for (int i = 0; i < b.length (); i++) \ + for (int i = 0; i < b.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = powf (a, b(i)); \ @@ -418,7 +418,7 @@ elem_xpow (float a, const T2 ## NDArray& b) \ { \ T2 ## NDArray result (b.dims ()); \ - for (int i = 0; i < b.length (); i++) \ + for (int i = 0; i < b.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = powf (a, b(i)); \ @@ -536,7 +536,7 @@ octave_value elem_xpow (T1 ## NDArray a, octave_ ## T2 b) \ { \ T1 ## NDArray result (a.dims ()); \ - for (int i = 0; i < a.length (); i++) \ + for (int i = 0; i < a.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = pow (a(i), b); \ @@ -547,7 +547,7 @@ octave_value elem_xpow (T1 ## NDArray a, double b) \ { \ T1 ## NDArray result (a.dims ()); \ - for (int i = 0; i < a.length (); i++) \ + for (int i = 0; i < a.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = pow (a(i), b); \ @@ -558,7 +558,7 @@ octave_value elem_xpow (NDArray a, octave_ ## T2 b) \ { \ T2 ## NDArray result (a.dims ()); \ - for (int i = 0; i < a.length (); i++) \ + for (int i = 0; i < a.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = pow (a(i), b); \ @@ -569,7 +569,7 @@ octave_value elem_xpow (T1 ## NDArray a, float b) \ { \ T1 ## NDArray result (a.dims ()); \ - for (int i = 0; i < a.length (); i++) \ + for (int i = 0; i < a.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = powf (a(i), b); \ @@ -580,7 +580,7 @@ octave_value elem_xpow (FloatNDArray a, octave_ ## T2 b) \ { \ T2 ## NDArray result (a.dims ()); \ - for (int i = 0; i < a.length (); i++) \ + for (int i = 0; i < a.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = powf (a(i), b); \ @@ -715,7 +715,7 @@ } \ } \ T1 ## NDArray result (a_dims); \ - for (int i = 0; i < a.length (); i++) \ + for (int i = 0; i < a.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = pow (a(i), b(i)); \ @@ -741,7 +741,7 @@ } \ } \ T1 ## NDArray result (a_dims); \ - for (int i = 0; i < a.length (); i++) \ + for (int i = 0; i < a.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = pow (a(i), b(i)); \ @@ -767,7 +767,7 @@ } \ } \ T2 ## NDArray result (a_dims); \ - for (int i = 0; i < a.length (); i++) \ + for (int i = 0; i < a.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = pow (a(i), b(i)); \ @@ -793,7 +793,7 @@ } \ } \ T1 ## NDArray result (a_dims); \ - for (int i = 0; i < a.length (); i++) \ + for (int i = 0; i < a.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = powf (a(i), b(i)); \ @@ -819,7 +819,7 @@ } \ } \ T2 ## NDArray result (a_dims); \ - for (int i = 0; i < a.length (); i++) \ + for (int i = 0; i < a.numel (); i++) \ { \ OCTAVE_QUIT; \ result (i) = powf (a(i), b(i)); \ diff -r 83792dd9bcc1 -r a9574e3c6e9e libinterp/parse-tree/pt-pr-code.cc --- a/libinterp/parse-tree/pt-pr-code.cc Tue May 26 21:07:42 2015 -0700 +++ b/libinterp/parse-tree/pt-pr-code.cc Sat May 30 03:14:07 2015 +0100 @@ -600,7 +600,7 @@ case '.': { string_vector nm = *p_arg_names; - assert (nm.length () == 1); + assert (nm.numel () == 1); os << "." << nm(0); } break; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/Array-util.cc --- a/liboctave/array/Array-util.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/Array-util.cc Sat May 30 03:14:07 2015 +0100 @@ -36,7 +36,7 @@ { bool retval = true; - int n = ra_idx.length (); + int n = ra_idx.numel (); if (n == dimensions.length ()) { @@ -61,7 +61,7 @@ { ra_idx(start_dimension)++; - int n = ra_idx.length () - 1; + int n = ra_idx.numel () - 1; int nda = dimensions.length (); for (int i = start_dimension; i < n; i++) @@ -81,7 +81,7 @@ { octave_idx_type retval (-1); - int n = idx.length (); + int n = idx.numel (); if (n > 0) { @@ -102,7 +102,7 @@ { octave_idx_type retval = 0; - for (octave_idx_type i = 0; i < ra_idx.length (); i++) + for (octave_idx_type i = 0; i < ra_idx.numel (); i++) { if (ra_idx(i) == 1) retval++; @@ -162,7 +162,7 @@ { bool retval = false; - for (octave_idx_type i = 0; i < arr.length (); i++) + for (octave_idx_type i = 0; i < arr.numel (); i++) { if (arr (i) == 1) { @@ -217,7 +217,7 @@ octave_idx_type compute_index (const Array& ra_idx, const dim_vector& dims) { - int nd = ra_idx.length (); + int nd = ra_idx.numel (); const dim_vector dv = dims.redim (nd); for (int d = 0; d < nd; d++) { @@ -235,7 +235,7 @@ { Array retval (a.dims ()); - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) retval(i) = a(i).elem (0); return retval; @@ -257,7 +257,7 @@ { dim_vector retval; - int n = ra_idx.length (); + int n = ra_idx.numel (); assert (n == dimensions.length ()); @@ -298,7 +298,7 @@ { bool retval = true; - octave_idx_type n = ra_idx.length (); + octave_idx_type n = ra_idx.numel (); for (octave_idx_type i = 0; i < n; i++) { @@ -317,7 +317,7 @@ { bool retval = false; - octave_idx_type n = ra_idx.length (); + octave_idx_type n = ra_idx.numel (); for (octave_idx_type i = 0; i < n; i++) { @@ -337,7 +337,7 @@ { bool retval = true; - octave_idx_type idx_n = ra_idx.length (); + octave_idx_type idx_n = ra_idx.numel (); int n = frozen_lengths.length (); @@ -360,7 +360,7 @@ { bool retval = true; - for (octave_idx_type i = 0; i < arr.length (); i++) + for (octave_idx_type i = 0; i < arr.numel (); i++) { if (arr(i) != 1) { @@ -376,7 +376,7 @@ get_elt_idx (const Array& ra_idx, const Array& result_idx) { - octave_idx_type n = ra_idx.length (); + octave_idx_type n = ra_idx.numel (); Array retval (dim_vector (n, 1)); @@ -423,7 +423,7 @@ dim_vector zero_dims_inquire (const Array& ia, const dim_vector& rhdv) { - int ial = ia.length (); + int ial = ia.numel (); int rhdvl = rhdv.length (); dim_vector rdv = dim_vector::alloc (ial); bool *scalar = new bool [ial]; @@ -530,7 +530,7 @@ sub2ind (const dim_vector& dv, const Array& idxa) { idx_vector retval; - octave_idx_type len = idxa.length (); + octave_idx_type len = idxa.numel (); if (len >= 1) { diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/Array.cc --- a/liboctave/array/Array.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/Array.cc Sat May 30 03:14:07 2015 +0100 @@ -72,7 +72,7 @@ if (rep->count > 1) { --rep->count; - rep = new ArrayRep (length (), val); + rep = new ArrayRep (numel (), val); slice_data = rep->data; } else @@ -313,7 +313,7 @@ : n (dv.length ()), top (0), dim (new octave_idx_type [2*n]), stride (dim + n), use_blk (false) { - assert (n == perm.length ()); + assert (n == perm.numel ()); // Get cumulative dimensions. OCTAVE_LOCAL_BUFFER (octave_idx_type, cdim, n+1); @@ -446,7 +446,7 @@ dim_vector dv = dims (); - int perm_vec_len = perm_vec_arg.length (); + int perm_vec_len = perm_vec_arg.numel (); if (perm_vec_len < dv.length ()) (*current_liboctave_error_handler) @@ -532,7 +532,7 @@ public: rec_index_helper (const dim_vector& dv, const Array& ia) - : n (ia.length ()), top (0), dim (new octave_idx_type [2*n]), + : n (ia.numel ()), top (0), dim (new octave_idx_type [2*n]), cdim (dim + n), idx (new idx_vector [n]) { assert (n > 0 && (dv.length () == std::max (n, 2))); @@ -837,7 +837,7 @@ Array Array::index (const Array& ia) const { - int ial = ia.length (); + int ial = ia.numel (); Array retval; // FIXME: is this dispatching necessary? @@ -1112,7 +1112,7 @@ Array tmp = *this; if (resize_ok) { - int ial = ia.length (); + int ial = ia.numel (); dim_vector dv = dimensions.redim (ial); dim_vector dvx = dim_vector::alloc (ial); for (int i = 0; i < ial; i++) dvx(i) = ia(i).extent (dv(i)); @@ -1290,7 +1290,7 @@ Array::assign (const Array& ia, const Array& rhs, const T& rfv) { - int ial = ia.length (); + int ial = ia.numel (); // FIXME: is this dispatching necessary / desirable? if (ial == 1) @@ -1492,7 +1492,7 @@ void Array::delete_elements (const Array& ia) { - int ial = ia.length (); + int ial = ia.numel (); if (ial == 1) delete_elements (ia(0)); @@ -1590,7 +1590,7 @@ Array& Array::insert (const Array& a, const Array& ra_idx) { - octave_idx_type n = ra_idx.length (); + octave_idx_type n = ra_idx.numel (); Array idx (dim_vector (n, 1)); const dim_vector dva = a.dims ().redim (n); for (octave_idx_type k = 0; k < n; k++) @@ -1776,7 +1776,7 @@ dim_vector dv = m.dims (); - if (m.length () < 1) + if (m.numel () < 1) return m; if (dim >= dv.length ()) @@ -1897,7 +1897,7 @@ dim_vector dv = m.dims (); - if (m.length () < 1) + if (m.numel () < 1) { sidx = Array (dv); return m; @@ -2317,7 +2317,7 @@ || (rows () == 0 && dims ().numel (1) == 0)) retval.dimensions = dim_vector (); else if (rows () == 1 && ndims () == 2) - retval.dimensions = dim_vector (1, retval.length ()); + retval.dimensions = dim_vector (1, retval.numel ()); return retval; } diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/Array.h --- a/liboctave/array/Array.h Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/Array.h Sat May 30 03:14:07 2015 +0100 @@ -88,7 +88,7 @@ ~ArrayRep (void) { delete [] data; } - octave_idx_type length (void) const { return len; } + octave_idx_type numel (void) const { return len; } private: @@ -203,7 +203,7 @@ template Array (const Array& a) : dimensions (a.dims ()), - rep (new typename Array::ArrayRep (a.data (), a.length ())), + rep (new typename Array::ArrayRep (a.data (), a.numel ())), slice_data (rep->data), slice_len (rep->len) { } @@ -266,7 +266,7 @@ length of the greatest dimension. This method returns the total number of elements. */ - octave_idx_type length (void) const { return numel (); } + GCC_ATTR_DEPRECATED octave_idx_type length (void) const { return numel (); } //! Number of elements in the array. //! Synonymous with numel(). @@ -348,7 +348,7 @@ octave_idx_type compute_index_unchecked (const Array& ra_idx) const - { return dimensions.compute_index (ra_idx.data (), ra_idx.length ()); } + { return dimensions.compute_index (ra_idx.data (), ra_idx.numel ()); } // No checking, even for multiple references, ever. @@ -660,7 +660,7 @@ Array map (F fcn) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); const T *m = data (); @@ -703,7 +703,7 @@ template bool test (F fcn) const { - return any_all_test (fcn, data (), length ()); + return any_all_test (fcn, data (), numel ()); } //@{ diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/CColVector.cc --- a/liboctave/array/CColVector.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/CColVector.cc Sat May 30 03:14:07 2015 +0100 @@ -60,8 +60,8 @@ bool ComplexColumnVector::operator == (const ComplexColumnVector& a) const { - octave_idx_type len = length (); - if (len != a.length ()) + octave_idx_type len = numel (); + if (len != a.numel ()) return 0; return mx_inline_equal (len, data (), a.data ()); } @@ -77,9 +77,9 @@ ComplexColumnVector& ComplexColumnVector::insert (const ColumnVector& a, octave_idx_type r) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (r < 0 || r + a_len > length ()) + if (r < 0 || r + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -99,9 +99,9 @@ ComplexColumnVector& ComplexColumnVector::insert (const ComplexColumnVector& a, octave_idx_type r) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (r < 0 || r + a_len > length ()) + if (r < 0 || r + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -121,7 +121,7 @@ ComplexColumnVector& ComplexColumnVector::fill (double val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -137,7 +137,7 @@ ComplexColumnVector& ComplexColumnVector::fill (const Complex& val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -154,7 +154,7 @@ ComplexColumnVector& ComplexColumnVector::fill (double val, octave_idx_type r1, octave_idx_type r2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (r1 < 0 || r2 < 0 || r1 >= len || r2 >= len) { @@ -179,7 +179,7 @@ ComplexColumnVector::fill (const Complex& val, octave_idx_type r1, octave_idx_type r2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (r1 < 0 || r2 < 0 || r1 >= len || r2 >= len) { @@ -203,9 +203,9 @@ ComplexColumnVector ComplexColumnVector::stack (const ColumnVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nr_insert = len; - ComplexColumnVector retval (len + a.length ()); + ComplexColumnVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nr_insert); return retval; @@ -214,9 +214,9 @@ ComplexColumnVector ComplexColumnVector::stack (const ComplexColumnVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nr_insert = len; - ComplexColumnVector retval (len + a.length ()); + ComplexColumnVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nr_insert); return retval; @@ -279,9 +279,9 @@ ComplexColumnVector& ComplexColumnVector::operator += (const ColumnVector& a) { - octave_idx_type len = length (); + octave_idx_type len = numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) { @@ -301,9 +301,9 @@ ComplexColumnVector& ComplexColumnVector::operator -= (const ColumnVector& a) { - octave_idx_type len = length (); + octave_idx_type len = numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) { @@ -337,7 +337,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) gripe_nonconformant ("operator *", nr, nc, a_len, 1); @@ -382,7 +382,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) { @@ -410,7 +410,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) { @@ -438,7 +438,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) { @@ -465,7 +465,7 @@ Complex ComplexColumnVector::min (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0.0; @@ -485,7 +485,7 @@ Complex ComplexColumnVector::max (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0.0; @@ -508,7 +508,7 @@ operator << (std::ostream& os, const ComplexColumnVector& a) { // int field_width = os.precision () + 7; - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) os << /* setw (field_width) << */ a.elem (i) << "\n"; return os; } @@ -516,7 +516,7 @@ std::istream& operator >> (std::istream& is, ComplexColumnVector& a) { - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); if (len > 0) { diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/CDiagMatrix.cc --- a/liboctave/array/CDiagMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/CDiagMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -110,7 +110,7 @@ ComplexDiagMatrix::fill (const ColumnVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -126,7 +126,7 @@ ComplexDiagMatrix::fill (const ComplexColumnVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -142,7 +142,7 @@ ComplexDiagMatrix::fill (const RowVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -158,7 +158,7 @@ ComplexDiagMatrix::fill (const ComplexRowVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -173,7 +173,7 @@ ComplexDiagMatrix& ComplexDiagMatrix::fill (const ColumnVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); @@ -189,7 +189,7 @@ ComplexDiagMatrix& ComplexDiagMatrix::fill (const ComplexColumnVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); @@ -205,7 +205,7 @@ ComplexDiagMatrix& ComplexDiagMatrix::fill (const RowVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); @@ -221,7 +221,7 @@ ComplexDiagMatrix& ComplexDiagMatrix::fill (const ComplexRowVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/CMatrix.cc --- a/liboctave/array/CMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/CMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -366,7 +366,7 @@ if (rows () != a.rows () || cols () != a.cols ()) return false; - return mx_inline_equal (length (), data (), a.data ()); + return mx_inline_equal (numel (), data (), a.data ()); } bool @@ -423,7 +423,7 @@ ComplexMatrix& ComplexMatrix::insert (const RowVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r >= rows () || c < 0 || c + a_len > cols ()) { @@ -446,7 +446,7 @@ ComplexMatrix::insert (const ColumnVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r + a_len > rows () || c < 0 || c >= cols ()) { @@ -505,7 +505,7 @@ ComplexMatrix::insert (const ComplexRowVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r >= rows () || c < 0 || c + a_len > cols ()) { (*current_liboctave_error_handler) ("range error for insert"); @@ -522,7 +522,7 @@ ComplexMatrix::insert (const ComplexColumnVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r + a_len > rows () || c < 0 || c >= cols ()) { @@ -693,7 +693,7 @@ } octave_idx_type nc_insert = nc; - ComplexMatrix retval (nr, nc + a.length ()); + ComplexMatrix retval (nr, nc + a.numel ()); retval.insert (*this, 0, 0); retval.insert (a, 0, nc_insert); return retval; @@ -704,7 +704,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nr != a.length ()) + if (nr != a.numel ()) { (*current_liboctave_error_handler) ("row dimension mismatch for append"); return *this; @@ -765,7 +765,7 @@ } octave_idx_type nc_insert = nc; - ComplexMatrix retval (nr, nc + a.length ()); + ComplexMatrix retval (nr, nc + a.numel ()); retval.insert (*this, 0, 0); retval.insert (a, 0, nc_insert); return retval; @@ -776,7 +776,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nr != a.length ()) + if (nr != a.numel ()) { (*current_liboctave_error_handler) ("row dimension mismatch for append"); return *this; @@ -831,7 +831,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nc != a.length ()) + if (nc != a.numel ()) { (*current_liboctave_error_handler) ("column dimension mismatch for stack"); @@ -858,7 +858,7 @@ } octave_idx_type nr_insert = nr; - ComplexMatrix retval (nr + a.length (), nc); + ComplexMatrix retval (nr + a.numel (), nc); retval.insert (*this, 0, 0); retval.insert (a, nr_insert, 0); return retval; @@ -907,7 +907,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nc != a.length ()) + if (nc != a.numel ()) { (*current_liboctave_error_handler) ("column dimension mismatch for stack"); @@ -934,7 +934,7 @@ } octave_idx_type nr_insert = nr; - ComplexMatrix retval (nr + a.length (), nc); + ComplexMatrix retval (nr + a.numel (), nc); retval.insert (*this, 0, 0); retval.insert (a, nr_insert, 0); return retval; @@ -1229,7 +1229,7 @@ ColumnVector sigma = S.extract_diag (); - octave_idx_type r = sigma.length () - 1; + octave_idx_type r = sigma.numel () - 1; octave_idx_type nr = rows (); octave_idx_type nc = cols (); @@ -2844,7 +2844,7 @@ octave_idx_type m = rows (); octave_idx_type n = cols (); - if (m != b.length ()) + if (m != b.numel ()) (*current_liboctave_error_handler) ("matrix dimension mismatch solution of linear equations"); else if (m == 0 || n == 0 || b.cols () == 0) @@ -2957,11 +2957,11 @@ { ComplexMatrix retval; - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); if (len != 0) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); retval = ComplexMatrix (len, a_len); Complex *c = retval.fortran_vec (); @@ -3085,7 +3085,7 @@ Complex *d = fortran_vec (); // Ensures only one reference to my privates! - mx_inline_add2 (length (), d, a.data ()); + mx_inline_add2 (numel (), d, a.data ()); return *this; } @@ -3109,7 +3109,7 @@ Complex *d = fortran_vec (); // Ensures only one reference to my privates! - mx_inline_sub2 (length (), d, a.data ()); + mx_inline_sub2 (numel (), d, a.data ()); return *this; } @@ -4001,9 +4001,9 @@ { if (n < 1) n = 1; - octave_idx_type m = x1.length (); - - if (x2.length () != m) + octave_idx_type m = x1.numel (); + + if (x2.numel () != m) (*current_liboctave_error_handler) ("linspace: vectors must be of equal length"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/CRowVector.cc --- a/liboctave/array/CRowVector.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/CRowVector.cc Sat May 30 03:14:07 2015 +0100 @@ -59,8 +59,8 @@ bool ComplexRowVector::operator == (const ComplexRowVector& a) const { - octave_idx_type len = length (); - if (len != a.length ()) + octave_idx_type len = numel (); + if (len != a.numel ()) return 0; return mx_inline_equal (len, data (), a.data ()); } @@ -76,9 +76,9 @@ ComplexRowVector& ComplexRowVector::insert (const RowVector& a, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (c < 0 || c + a_len > length ()) + if (c < 0 || c + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -98,9 +98,9 @@ ComplexRowVector& ComplexRowVector::insert (const ComplexRowVector& a, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (c < 0 || c + a_len > length ()) + if (c < 0 || c + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -120,7 +120,7 @@ ComplexRowVector& ComplexRowVector::fill (double val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -136,7 +136,7 @@ ComplexRowVector& ComplexRowVector::fill (const Complex& val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -152,7 +152,7 @@ ComplexRowVector& ComplexRowVector::fill (double val, octave_idx_type c1, octave_idx_type c2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (c1 < 0 || c2 < 0 || c1 >= len || c2 >= len) { @@ -177,7 +177,7 @@ ComplexRowVector::fill (const Complex& val, octave_idx_type c1, octave_idx_type c2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (c1 < 0 || c2 < 0 || c1 >= len || c2 >= len) { @@ -201,9 +201,9 @@ ComplexRowVector ComplexRowVector::append (const RowVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nc_insert = len; - ComplexRowVector retval (len + a.length ()); + ComplexRowVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nc_insert); return retval; @@ -212,9 +212,9 @@ ComplexRowVector ComplexRowVector::append (const ComplexRowVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nc_insert = len; - ComplexRowVector retval (len + a.length ()); + ComplexRowVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nc_insert); return retval; @@ -271,9 +271,9 @@ ComplexRowVector& ComplexRowVector::operator += (const RowVector& a) { - octave_idx_type len = length (); + octave_idx_type len = numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) { @@ -293,9 +293,9 @@ ComplexRowVector& ComplexRowVector::operator -= (const RowVector& a) { - octave_idx_type len = length (); + octave_idx_type len = numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) { @@ -319,7 +319,7 @@ { ComplexRowVector retval; - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); octave_idx_type a_nr = a.rows (); octave_idx_type a_nc = a.cols (); @@ -361,7 +361,7 @@ Complex ComplexRowVector::min (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return Complex (0.0); @@ -381,7 +381,7 @@ Complex ComplexRowVector::max (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return Complex (0.0); @@ -404,7 +404,7 @@ operator << (std::ostream& os, const ComplexRowVector& a) { // int field_width = os.precision () + 7; - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) os << " " /* setw (field_width) */ << a.elem (i); return os; } @@ -412,7 +412,7 @@ std::istream& operator >> (std::istream& is, ComplexRowVector& a) { - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); if (len > 0) { @@ -445,9 +445,9 @@ { Complex retval (0.0, 0.0); - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) gripe_nonconformant ("operator *", len, a_len); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/DiagArray2.cc --- a/liboctave/array/DiagArray2.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/DiagArray2.cc Sat May 30 03:14:07 2015 +0100 @@ -42,7 +42,7 @@ : Array (a.as_column ()), d1 (r), d2 (c) { octave_idx_type rcmin = std::min (r, c); - if (rcmin != a.length ()) + if (rcmin != a.numel ()) Array::resize (dim_vector (rcmin, 1)); } diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/DiagArray2.h --- a/liboctave/array/DiagArray2.h Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/DiagArray2.h Sat May 30 03:14:07 2015 +0100 @@ -87,9 +87,9 @@ octave_idx_type cols (void) const { return dim2 (); } octave_idx_type columns (void) const { return dim2 (); } - octave_idx_type diag_length (void) const { return Array::length (); } + octave_idx_type diag_length (void) const { return Array::numel (); } // FIXME: a dangerous ambiguity? - octave_idx_type length (void) const { return Array::length (); } + octave_idx_type length (void) const { return Array::numel (); } octave_idx_type nelem (void) const { return dim1 () * dim2 (); } octave_idx_type numel (void) const { return nelem (); } diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/MArray.cc --- a/liboctave/array/MArray.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/MArray.cc Sat May 30 03:14:07 2015 +0100 @@ -56,7 +56,7 @@ void MArray::idx_add (const idx_vector& idx, T val) { - octave_idx_type n = this->length (); + octave_idx_type n = this->numel (); octave_idx_type ext = idx.extent (n); if (ext > n) { @@ -74,7 +74,7 @@ void MArray::idx_add (const idx_vector& idx, const MArray& vals) { - octave_idx_type n = this->length (); + octave_idx_type n = this->numel (); octave_idx_type ext = idx.extent (n); if (ext > n) { @@ -84,7 +84,7 @@ octave_quit (); - octave_idx_type len = std::min (idx.length (n), vals.length ()); + octave_idx_type len = std::min (idx.length (n), vals.numel ()); idx.loop (len, _idxadda_helper (this->fortran_vec (), vals.data ())); } @@ -103,7 +103,7 @@ void MArray::idx_min (const idx_vector& idx, const MArray& vals) { - octave_idx_type n = this->length (); + octave_idx_type n = this->numel (); octave_idx_type ext = idx.extent (n); if (ext > n) { @@ -113,7 +113,7 @@ octave_quit (); - octave_idx_type len = std::min (idx.length (n), vals.length ()); + octave_idx_type len = std::min (idx.length (n), vals.numel ()); idx.loop (len, _idxbinop_helper (this->fortran_vec (), vals.data ())); } @@ -122,7 +122,7 @@ void MArray::idx_max (const idx_vector& idx, const MArray& vals) { - octave_idx_type n = this->length (); + octave_idx_type n = this->numel (); octave_idx_type ext = idx.extent (n); if (ext > n) { @@ -132,7 +132,7 @@ octave_quit (); - octave_idx_type len = std::min (idx.length (n), vals.length ()); + octave_idx_type len = std::min (idx.length (n), vals.numel ()); idx.loop (len, _idxbinop_helper (this->fortran_vec (), vals.data ())); } diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/PermMatrix.cc --- a/liboctave/array/PermMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/PermMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -41,7 +41,7 @@ { if (check) { - if (! idx_vector (p).is_permutation (p.length ())) + if (! idx_vector (p).is_permutation (p.numel ())) { gripe_invalid_permutation (); Array::operator = (Array ()); @@ -104,7 +104,7 @@ octave_idx_type PermMatrix::checkelem (octave_idx_type i, octave_idx_type j) const { - octave_idx_type len = Array::length (); + octave_idx_type len = Array::numel (); if (i < 0 || j < 0 || i > len || j > len) { (*current_liboctave_error_handler) ("index out of range"); @@ -118,7 +118,7 @@ PermMatrix PermMatrix::transpose (void) const { - octave_idx_type len = Array::length (); + octave_idx_type len = Array::numel (); PermMatrix retval (len); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/PermMatrix.h --- a/liboctave/array/PermMatrix.h Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/PermMatrix.h Sat May 30 03:14:07 2015 +0100 @@ -48,16 +48,16 @@ PermMatrix (const idx_vector& idx, bool colp, octave_idx_type n = 0); octave_idx_type dim1 (void) const - { return Array::length (); } + { return Array::numel (); } octave_idx_type dim2 (void) const - { return Array::length (); } + { return Array::numel (); } octave_idx_type rows (void) const { return dim1 (); } octave_idx_type cols (void) const { return dim2 (); } octave_idx_type columns (void) const { return dim2 (); } octave_idx_type perm_length (void) const - { return Array::length (); } + { return Array::numel (); } // FIXME: a dangerous ambiguity? octave_idx_type length (void) const { return perm_length (); } diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/Sparse.cc --- a/liboctave/array/Sparse.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/Sparse.cc Sat May 30 03:14:07 2015 +0100 @@ -646,7 +646,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); octave_idx_type new_nzmx = 0; // First count the number of nonzero terms @@ -704,7 +704,7 @@ octave_idx_type n = dimensions.length (); - if (n > 0 && n == ra_idx.length ()) + if (n > 0 && n == ra_idx.numel ()) { retval = ra_idx(--n); @@ -767,7 +767,7 @@ buf << fcn << " ("; - octave_idx_type n = ra_idx.length (); + octave_idx_type n = ra_idx.numel (); if (n > 0) buf << ra_idx(0); @@ -792,7 +792,7 @@ buf << fcn << " ("; - octave_idx_type n = ra_idx.length (); + octave_idx_type n = ra_idx.numel (); if (n > 0) buf << ra_idx(0); @@ -886,7 +886,7 @@ bool fail = false; bool trans = false; - if (perm_vec.length () == 2) + if (perm_vec.numel () == 2) { if (perm_vec(0) == 0 && perm_vec(1) == 1) /* do nothing */; @@ -1082,7 +1082,7 @@ Sparse::insert (const Sparse& a, const Array& ra_idx) { - if (ra_idx.length () != 2) + if (ra_idx.numel () != 2) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -2244,7 +2244,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.columns (); - if (m.length () < 1 || dim > 1) + if (m.numel () < 1 || dim > 1) return m; if (dim > 0) @@ -2310,7 +2310,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.columns (); - if (m.length () < 1 || dim > 1) + if (m.numel () < 1 || dim > 1) { sidx = Array (dim_vector (nr, nc), 1); return m; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/Sparse.h --- a/liboctave/array/Sparse.h Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/Sparse.h Sat May 30 03:14:07 2015 +0100 @@ -257,7 +257,7 @@ } GCC_ATTR_DEPRECATED octave_idx_type nelem (void) const { return nzmax (); } - octave_idx_type length (void) const { return numel (); } + GCC_ATTR_DEPRECATED octave_idx_type length (void) const { return numel (); } octave_idx_type dim1 (void) const { return dimensions(0); } octave_idx_type dim2 (void) const { return dimensions(1); } diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/boolMatrix.cc --- a/liboctave/array/boolMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/boolMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -43,7 +43,7 @@ if (rows () != a.rows () || cols () != a.cols ()) return 0; - return mx_inline_equal (length (), data (), a.data ()); + return mx_inline_equal (numel (), data (), a.data ()); } bool diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/chMatrix.cc --- a/liboctave/array/chMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/chMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -45,7 +45,7 @@ if (rows () != a.rows () || cols () != a.cols ()) return 0; - return mx_inline_equal (length (), data (), a.data ()); + return mx_inline_equal (numel (), data (), a.data ()); } bool diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/chNDArray.cc --- a/liboctave/array/chNDArray.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/chNDArray.cc Sat May 30 03:14:07 2015 +0100 @@ -70,7 +70,7 @@ } charNDArray::charNDArray (const string_vector& s, char fill_value) - : Array (dim_vector (s.length (), s.max_length ()), fill_value) + : Array (dim_vector (s.numel (), s.max_length ()), fill_value) { octave_idx_type nr = rows (); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/dColVector.cc --- a/liboctave/array/dColVector.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/dColVector.cc Sat May 30 03:14:07 2015 +0100 @@ -55,8 +55,8 @@ bool ColumnVector::operator == (const ColumnVector& a) const { - octave_idx_type len = length (); - if (len != a.length ()) + octave_idx_type len = numel (); + if (len != a.numel ()) return 0; return mx_inline_equal (len, data (), a.data ()); } @@ -70,9 +70,9 @@ ColumnVector& ColumnVector::insert (const ColumnVector& a, octave_idx_type r) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (r < 0 || r + a_len > length ()) + if (r < 0 || r + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -92,7 +92,7 @@ ColumnVector& ColumnVector::fill (double val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -108,7 +108,7 @@ ColumnVector& ColumnVector::fill (double val, octave_idx_type r1, octave_idx_type r2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (r1 < 0 || r2 < 0 || r1 >= len || r2 >= len) { @@ -132,9 +132,9 @@ ColumnVector ColumnVector::stack (const ColumnVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nr_insert = len; - ColumnVector retval (len + a.length ()); + ColumnVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nr_insert); return retval; @@ -202,7 +202,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) gripe_nonconformant ("operator *", nr, nc, a_len, 1); @@ -239,7 +239,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) gripe_nonconformant ("operator *", nr, nc, a_len, 1); @@ -267,7 +267,7 @@ double ColumnVector::min (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0.0; @@ -283,7 +283,7 @@ double ColumnVector::max (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0.0; @@ -300,7 +300,7 @@ operator << (std::ostream& os, const ColumnVector& a) { // int field_width = os.precision () + 7; - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) os << /* setw (field_width) << */ a.elem (i) << "\n"; return os; } @@ -308,7 +308,7 @@ std::istream& operator >> (std::istream& is, ColumnVector& a) { - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); if (len > 0) { diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/dDiagMatrix.cc --- a/liboctave/array/dDiagMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/dDiagMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -78,7 +78,7 @@ DiagMatrix::fill (const ColumnVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -94,7 +94,7 @@ DiagMatrix::fill (const RowVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -109,7 +109,7 @@ DiagMatrix& DiagMatrix::fill (const ColumnVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); @@ -125,7 +125,7 @@ DiagMatrix& DiagMatrix::fill (const RowVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/dMatrix.cc --- a/liboctave/array/dMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/dMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -306,7 +306,7 @@ if (rows () != a.rows () || cols () != a.cols ()) return false; - return mx_inline_equal (length (), data (), a.data ()); + return mx_inline_equal (numel (), data (), a.data ()); } bool @@ -341,7 +341,7 @@ Matrix& Matrix::insert (const RowVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r >= rows () || c < 0 || c + a_len > cols ()) { @@ -363,7 +363,7 @@ Matrix& Matrix::insert (const ColumnVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r + a_len > rows () || c < 0 || c >= cols ()) { @@ -486,7 +486,7 @@ } octave_idx_type nc_insert = nc; - Matrix retval (nr, nc + a.length ()); + Matrix retval (nr, nc + a.numel ()); retval.insert (*this, 0, 0); retval.insert (a, 0, nc_insert); return retval; @@ -497,7 +497,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nr != a.length ()) + if (nr != a.numel ()) { (*current_liboctave_error_handler) ("row dimension mismatch for append"); return Matrix (); @@ -552,7 +552,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nc != a.length ()) + if (nc != a.numel ()) { (*current_liboctave_error_handler) ("column dimension mismatch for stack"); @@ -579,7 +579,7 @@ } octave_idx_type nr_insert = nr; - Matrix retval (nr + a.length (), nc); + Matrix retval (nr + a.numel (), nc); retval.insert (*this, 0, 0); retval.insert (a, nr_insert, 0); return retval; @@ -877,7 +877,7 @@ ColumnVector sigma = S.extract_diag (); - octave_idx_type r = sigma.length () - 1; + octave_idx_type r = sigma.numel () - 1; octave_idx_type nr = rows (); octave_idx_type nc = cols (); @@ -2467,7 +2467,7 @@ octave_idx_type m = rows (); octave_idx_type n = cols (); - if (m != b.length ()) + if (m != b.numel ()) (*current_liboctave_error_handler) ("matrix dimension mismatch solution of linear equations"); else if (m == 0 || n == 0) @@ -2636,11 +2636,11 @@ { Matrix retval; - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); if (len != 0) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); retval = Matrix (len, a_len); double *c = retval.fortran_vec (); @@ -3332,9 +3332,9 @@ { if (n < 1) n = 1; - octave_idx_type m = x1.length (); - - if (x2.length () != m) + octave_idx_type m = x1.numel (); + + if (x2.numel () != m) (*current_liboctave_error_handler) ("linspace: vectors must be of equal length"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/dRowVector.cc --- a/liboctave/array/dRowVector.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/dRowVector.cc Sat May 30 03:14:07 2015 +0100 @@ -58,8 +58,8 @@ bool RowVector::operator == (const RowVector& a) const { - octave_idx_type len = length (); - if (len != a.length ()) + octave_idx_type len = numel (); + if (len != a.numel ()) return 0; return mx_inline_equal (len, data (), a.data ()); } @@ -73,9 +73,9 @@ RowVector& RowVector::insert (const RowVector& a, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (c < 0 || c + a_len > length ()) + if (c < 0 || c + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -95,7 +95,7 @@ RowVector& RowVector::fill (double val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -111,7 +111,7 @@ RowVector& RowVector::fill (double val, octave_idx_type c1, octave_idx_type c2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (c1 < 0 || c2 < 0 || c1 >= len || c2 >= len) { @@ -135,9 +135,9 @@ RowVector RowVector::append (const RowVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nc_insert = len; - RowVector retval (len + a.length ()); + RowVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nc_insert); return retval; @@ -194,7 +194,7 @@ { RowVector retval; - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); octave_idx_type a_nr = a.rows (); octave_idx_type a_nc = a.cols (); @@ -229,7 +229,7 @@ double RowVector::min (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0; @@ -245,7 +245,7 @@ double RowVector::max (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0; @@ -263,7 +263,7 @@ { // int field_width = os.precision () + 7; - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) os << " " /* setw (field_width) */ << a.elem (i); return os; } @@ -271,7 +271,7 @@ std::istream& operator >> (std::istream& is, RowVector& a) { - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); if (len > 0) { @@ -313,9 +313,9 @@ { double retval = 0.0; - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) gripe_nonconformant ("operator *", len, a_len); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/fCColVector.cc --- a/liboctave/array/fCColVector.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/fCColVector.cc Sat May 30 03:14:07 2015 +0100 @@ -60,8 +60,8 @@ bool FloatComplexColumnVector::operator == (const FloatComplexColumnVector& a) const { - octave_idx_type len = length (); - if (len != a.length ()) + octave_idx_type len = numel (); + if (len != a.numel ()) return 0; return mx_inline_equal (len, data (), a.data ()); } @@ -77,9 +77,9 @@ FloatComplexColumnVector& FloatComplexColumnVector::insert (const FloatColumnVector& a, octave_idx_type r) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (r < 0 || r + a_len > length ()) + if (r < 0 || r + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -100,9 +100,9 @@ FloatComplexColumnVector::insert (const FloatComplexColumnVector& a, octave_idx_type r) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (r < 0 || r + a_len > length ()) + if (r < 0 || r + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -122,7 +122,7 @@ FloatComplexColumnVector& FloatComplexColumnVector::fill (float val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -138,7 +138,7 @@ FloatComplexColumnVector& FloatComplexColumnVector::fill (const FloatComplex& val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -156,7 +156,7 @@ FloatComplexColumnVector::fill (float val, octave_idx_type r1, octave_idx_type r2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (r1 < 0 || r2 < 0 || r1 >= len || r2 >= len) { @@ -181,7 +181,7 @@ FloatComplexColumnVector::fill (const FloatComplex& val, octave_idx_type r1, octave_idx_type r2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (r1 < 0 || r2 < 0 || r1 >= len || r2 >= len) { @@ -205,9 +205,9 @@ FloatComplexColumnVector FloatComplexColumnVector::stack (const FloatColumnVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nr_insert = len; - FloatComplexColumnVector retval (len + a.length ()); + FloatComplexColumnVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nr_insert); return retval; @@ -216,9 +216,9 @@ FloatComplexColumnVector FloatComplexColumnVector::stack (const FloatComplexColumnVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nr_insert = len; - FloatComplexColumnVector retval (len + a.length ()); + FloatComplexColumnVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nr_insert); return retval; @@ -282,9 +282,9 @@ FloatComplexColumnVector& FloatComplexColumnVector::operator += (const FloatColumnVector& a) { - octave_idx_type len = length (); + octave_idx_type len = numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) { @@ -304,9 +304,9 @@ FloatComplexColumnVector& FloatComplexColumnVector::operator -= (const FloatColumnVector& a) { - octave_idx_type len = length (); + octave_idx_type len = numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) { @@ -340,7 +340,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) gripe_nonconformant ("operator *", nr, nc, a_len, 1); @@ -384,7 +384,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) { @@ -412,7 +412,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) { @@ -440,7 +440,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) { @@ -467,7 +467,7 @@ FloatComplex FloatComplexColumnVector::min (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0.0; @@ -487,7 +487,7 @@ FloatComplex FloatComplexColumnVector::max (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0.0; @@ -510,7 +510,7 @@ operator << (std::ostream& os, const FloatComplexColumnVector& a) { // int field_width = os.precision () + 7; - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) os << /* setw (field_width) << */ a.elem (i) << "\n"; return os; } @@ -518,7 +518,7 @@ std::istream& operator >> (std::istream& is, FloatComplexColumnVector& a) { - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); if (len > 0) { diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/fCDiagMatrix.cc --- a/liboctave/array/fCDiagMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/fCDiagMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -111,7 +111,7 @@ FloatComplexDiagMatrix::fill (const FloatColumnVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -127,7 +127,7 @@ FloatComplexDiagMatrix::fill (const FloatComplexColumnVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -143,7 +143,7 @@ FloatComplexDiagMatrix::fill (const FloatRowVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -159,7 +159,7 @@ FloatComplexDiagMatrix::fill (const FloatComplexRowVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -174,7 +174,7 @@ FloatComplexDiagMatrix& FloatComplexDiagMatrix::fill (const FloatColumnVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); @@ -191,7 +191,7 @@ FloatComplexDiagMatrix::fill (const FloatComplexColumnVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); @@ -207,7 +207,7 @@ FloatComplexDiagMatrix& FloatComplexDiagMatrix::fill (const FloatRowVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); @@ -224,7 +224,7 @@ FloatComplexDiagMatrix::fill (const FloatComplexRowVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/fCMatrix.cc --- a/liboctave/array/fCMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/fCMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -369,7 +369,7 @@ if (rows () != a.rows () || cols () != a.cols ()) return false; - return mx_inline_equal (length (), data (), a.data ()); + return mx_inline_equal (numel (), data (), a.data ()); } bool @@ -428,7 +428,7 @@ FloatComplexMatrix::insert (const FloatRowVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r >= rows () || c < 0 || c + a_len > cols ()) { @@ -451,7 +451,7 @@ FloatComplexMatrix::insert (const FloatColumnVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r + a_len > rows () || c < 0 || c >= cols ()) { @@ -510,7 +510,7 @@ FloatComplexMatrix::insert (const FloatComplexRowVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r >= rows () || c < 0 || c + a_len > cols ()) { (*current_liboctave_error_handler) ("range error for insert"); @@ -527,7 +527,7 @@ FloatComplexMatrix::insert (const FloatComplexColumnVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r + a_len > rows () || c < 0 || c >= cols ()) { @@ -699,7 +699,7 @@ } octave_idx_type nc_insert = nc; - FloatComplexMatrix retval (nr, nc + a.length ()); + FloatComplexMatrix retval (nr, nc + a.numel ()); retval.insert (*this, 0, 0); retval.insert (a, 0, nc_insert); return retval; @@ -710,7 +710,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nr != a.length ()) + if (nr != a.numel ()) { (*current_liboctave_error_handler) ("row dimension mismatch for append"); return *this; @@ -771,7 +771,7 @@ } octave_idx_type nc_insert = nc; - FloatComplexMatrix retval (nr, nc + a.length ()); + FloatComplexMatrix retval (nr, nc + a.numel ()); retval.insert (*this, 0, 0); retval.insert (a, 0, nc_insert); return retval; @@ -782,7 +782,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nr != a.length ()) + if (nr != a.numel ()) { (*current_liboctave_error_handler) ("row dimension mismatch for append"); return *this; @@ -837,7 +837,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nc != a.length ()) + if (nc != a.numel ()) { (*current_liboctave_error_handler) ("column dimension mismatch for stack"); @@ -864,7 +864,7 @@ } octave_idx_type nr_insert = nr; - FloatComplexMatrix retval (nr + a.length (), nc); + FloatComplexMatrix retval (nr + a.numel (), nc); retval.insert (*this, 0, 0); retval.insert (a, nr_insert, 0); return retval; @@ -913,7 +913,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nc != a.length ()) + if (nc != a.numel ()) { (*current_liboctave_error_handler) ("column dimension mismatch for stack"); @@ -940,7 +940,7 @@ } octave_idx_type nr_insert = nr; - FloatComplexMatrix retval (nr + a.length (), nc); + FloatComplexMatrix retval (nr + a.numel (), nc); retval.insert (*this, 0, 0); retval.insert (a, nr_insert, 0); return retval; @@ -1236,7 +1236,7 @@ FloatColumnVector sigma = S.extract_diag (); - octave_idx_type r = sigma.length () - 1; + octave_idx_type r = sigma.numel () - 1; octave_idx_type nr = rows (); octave_idx_type nc = cols (); @@ -2862,7 +2862,7 @@ octave_idx_type m = rows (); octave_idx_type n = cols (); - if (m != b.length ()) + if (m != b.numel ()) (*current_liboctave_error_handler) ("matrix dimension mismatch solution of linear equations"); else if (m == 0 || n == 0 || b.cols () == 0) @@ -2975,11 +2975,11 @@ { FloatComplexMatrix retval; - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); if (len != 0) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); retval = FloatComplexMatrix (len, a_len); FloatComplex *c = retval.fortran_vec (); @@ -3103,7 +3103,7 @@ FloatComplex *d = fortran_vec (); // Ensures only 1 reference to my privates! - mx_inline_add2 (length (), d, a.data ()); + mx_inline_add2 (numel (), d, a.data ()); return *this; } @@ -3127,7 +3127,7 @@ FloatComplex *d = fortran_vec (); // Ensures only 1 reference to my privates! - mx_inline_sub2 (length (), d, a.data ()); + mx_inline_sub2 (numel (), d, a.data ()); return *this; } @@ -4021,9 +4021,9 @@ { if (n < 1) n = 1; - octave_idx_type m = x1.length (); - - if (x2.length () != m) + octave_idx_type m = x1.numel (); + + if (x2.numel () != m) (*current_liboctave_error_handler) ("linspace: vectors must be of equal length"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/fCRowVector.cc --- a/liboctave/array/fCRowVector.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/fCRowVector.cc Sat May 30 03:14:07 2015 +0100 @@ -59,8 +59,8 @@ bool FloatComplexRowVector::operator == (const FloatComplexRowVector& a) const { - octave_idx_type len = length (); - if (len != a.length ()) + octave_idx_type len = numel (); + if (len != a.numel ()) return 0; return mx_inline_equal (len, data (), a.data ()); } @@ -76,9 +76,9 @@ FloatComplexRowVector& FloatComplexRowVector::insert (const FloatRowVector& a, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (c < 0 || c + a_len > length ()) + if (c < 0 || c + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -99,9 +99,9 @@ FloatComplexRowVector::insert (const FloatComplexRowVector& a, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (c < 0 || c + a_len > length ()) + if (c < 0 || c + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -121,7 +121,7 @@ FloatComplexRowVector& FloatComplexRowVector::fill (float val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -137,7 +137,7 @@ FloatComplexRowVector& FloatComplexRowVector::fill (const FloatComplex& val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -153,7 +153,7 @@ FloatComplexRowVector& FloatComplexRowVector::fill (float val, octave_idx_type c1, octave_idx_type c2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (c1 < 0 || c2 < 0 || c1 >= len || c2 >= len) { @@ -178,7 +178,7 @@ FloatComplexRowVector::fill (const FloatComplex& val, octave_idx_type c1, octave_idx_type c2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (c1 < 0 || c2 < 0 || c1 >= len || c2 >= len) { @@ -202,9 +202,9 @@ FloatComplexRowVector FloatComplexRowVector::append (const FloatRowVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nc_insert = len; - FloatComplexRowVector retval (len + a.length ()); + FloatComplexRowVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nc_insert); return retval; @@ -213,9 +213,9 @@ FloatComplexRowVector FloatComplexRowVector::append (const FloatComplexRowVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nc_insert = len; - FloatComplexRowVector retval (len + a.length ()); + FloatComplexRowVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nc_insert); return retval; @@ -272,9 +272,9 @@ FloatComplexRowVector& FloatComplexRowVector::operator += (const FloatRowVector& a) { - octave_idx_type len = length (); + octave_idx_type len = numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) { @@ -294,9 +294,9 @@ FloatComplexRowVector& FloatComplexRowVector::operator -= (const FloatRowVector& a) { - octave_idx_type len = length (); + octave_idx_type len = numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) { @@ -320,7 +320,7 @@ { FloatComplexRowVector retval; - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); octave_idx_type a_nr = a.rows (); octave_idx_type a_nc = a.cols (); @@ -362,7 +362,7 @@ FloatComplex FloatComplexRowVector::min (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return FloatComplex (0.0); @@ -382,7 +382,7 @@ FloatComplex FloatComplexRowVector::max (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return FloatComplex (0.0); @@ -405,7 +405,7 @@ operator << (std::ostream& os, const FloatComplexRowVector& a) { // int field_width = os.precision () + 7; - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) os << " " /* setw (field_width) */ << a.elem (i); return os; } @@ -413,7 +413,7 @@ std::istream& operator >> (std::istream& is, FloatComplexRowVector& a) { - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); if (len > 0) { @@ -446,9 +446,9 @@ { FloatComplex retval (0.0, 0.0); - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) gripe_nonconformant ("operator *", len, a_len); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/fColVector.cc --- a/liboctave/array/fColVector.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/fColVector.cc Sat May 30 03:14:07 2015 +0100 @@ -54,8 +54,8 @@ bool FloatColumnVector::operator == (const FloatColumnVector& a) const { - octave_idx_type len = length (); - if (len != a.length ()) + octave_idx_type len = numel (); + if (len != a.numel ()) return 0; return mx_inline_equal (len, data (), a.data ()); } @@ -69,9 +69,9 @@ FloatColumnVector& FloatColumnVector::insert (const FloatColumnVector& a, octave_idx_type r) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (r < 0 || r + a_len > length ()) + if (r < 0 || r + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -91,7 +91,7 @@ FloatColumnVector& FloatColumnVector::fill (float val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -107,7 +107,7 @@ FloatColumnVector& FloatColumnVector::fill (float val, octave_idx_type r1, octave_idx_type r2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (r1 < 0 || r2 < 0 || r1 >= len || r2 >= len) { @@ -131,9 +131,9 @@ FloatColumnVector FloatColumnVector::stack (const FloatColumnVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nr_insert = len; - FloatColumnVector retval (len + a.length ()); + FloatColumnVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nr_insert); return retval; @@ -201,7 +201,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) gripe_nonconformant ("operator *", nr, nc, a_len, 1); @@ -238,7 +238,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.cols (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (nc != a_len) gripe_nonconformant ("operator *", nr, nc, a_len, 1); @@ -266,7 +266,7 @@ float FloatColumnVector::min (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0.0; @@ -282,7 +282,7 @@ float FloatColumnVector::max (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0.0; @@ -299,7 +299,7 @@ operator << (std::ostream& os, const FloatColumnVector& a) { // int field_width = os.precision () + 7; - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) os << /* setw (field_width) << */ a.elem (i) << "\n"; return os; } @@ -307,7 +307,7 @@ std::istream& operator >> (std::istream& is, FloatColumnVector& a) { - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); if (len > 0) { diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/fDiagMatrix.cc --- a/liboctave/array/fDiagMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/fDiagMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -78,7 +78,7 @@ FloatDiagMatrix::fill (const FloatColumnVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -94,7 +94,7 @@ FloatDiagMatrix::fill (const FloatRowVector& a) { octave_idx_type len = length (); - if (a.length () != len) + if (a.numel () != len) { (*current_liboctave_error_handler) ("range error for fill"); return *this; @@ -109,7 +109,7 @@ FloatDiagMatrix& FloatDiagMatrix::fill (const FloatColumnVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); @@ -125,7 +125,7 @@ FloatDiagMatrix& FloatDiagMatrix::fill (const FloatRowVector& a, octave_idx_type beg) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (beg < 0 || beg + a_len >= length ()) { (*current_liboctave_error_handler) ("range error for fill"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/fMatrix.cc --- a/liboctave/array/fMatrix.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/fMatrix.cc Sat May 30 03:14:07 2015 +0100 @@ -309,7 +309,7 @@ if (rows () != a.rows () || cols () != a.cols ()) return false; - return mx_inline_equal (length (), data (), a.data ()); + return mx_inline_equal (numel (), data (), a.data ()); } bool @@ -346,7 +346,7 @@ FloatMatrix::insert (const FloatRowVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r >= rows () || c < 0 || c + a_len > cols ()) { @@ -369,7 +369,7 @@ FloatMatrix::insert (const FloatColumnVector& a, octave_idx_type r, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (r < 0 || r + a_len > rows () || c < 0 || c >= cols ()) { @@ -493,7 +493,7 @@ } octave_idx_type nc_insert = nc; - FloatMatrix retval (nr, nc + a.length ()); + FloatMatrix retval (nr, nc + a.numel ()); retval.insert (*this, 0, 0); retval.insert (a, 0, nc_insert); return retval; @@ -504,7 +504,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nr != a.length ()) + if (nr != a.numel ()) { (*current_liboctave_error_handler) ("row dimension mismatch for append"); return FloatMatrix (); @@ -559,7 +559,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - if (nc != a.length ()) + if (nc != a.numel ()) { (*current_liboctave_error_handler) ("column dimension mismatch for stack"); @@ -586,7 +586,7 @@ } octave_idx_type nr_insert = nr; - FloatMatrix retval (nr + a.length (), nc); + FloatMatrix retval (nr + a.numel (), nc); retval.insert (*this, 0, 0); retval.insert (a, nr_insert, 0); return retval; @@ -884,7 +884,7 @@ FloatColumnVector sigma = S.extract_diag (); - octave_idx_type r = sigma.length () - 1; + octave_idx_type r = sigma.numel () - 1; octave_idx_type nr = rows (); octave_idx_type nc = cols (); @@ -2491,7 +2491,7 @@ octave_idx_type m = rows (); octave_idx_type n = cols (); - if (m != b.length ()) + if (m != b.numel ()) (*current_liboctave_error_handler) ("matrix dimension mismatch solution of linear equations"); else if (m == 0 || n == 0) @@ -2659,11 +2659,11 @@ { FloatMatrix retval; - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); if (len != 0) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); retval = FloatMatrix (len, a_len); float *c = retval.fortran_vec (); @@ -3337,9 +3337,9 @@ { if (n < 1) n = 1; - octave_idx_type m = x1.length (); - - if (x2.length () != m) + octave_idx_type m = x1.numel (); + + if (x2.numel () != m) (*current_liboctave_error_handler) ("linspace: vectors must be of equal length"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/fRowVector.cc --- a/liboctave/array/fRowVector.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/fRowVector.cc Sat May 30 03:14:07 2015 +0100 @@ -58,8 +58,8 @@ bool FloatRowVector::operator == (const FloatRowVector& a) const { - octave_idx_type len = length (); - if (len != a.length ()) + octave_idx_type len = numel (); + if (len != a.numel ()) return 0; return mx_inline_equal (len, data (), a.data ()); } @@ -73,9 +73,9 @@ FloatRowVector& FloatRowVector::insert (const FloatRowVector& a, octave_idx_type c) { - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); - if (c < 0 || c + a_len > length ()) + if (c < 0 || c + a_len > numel ()) { (*current_liboctave_error_handler) ("range error for insert"); return *this; @@ -95,7 +95,7 @@ FloatRowVector& FloatRowVector::fill (float val) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -111,7 +111,7 @@ FloatRowVector& FloatRowVector::fill (float val, octave_idx_type c1, octave_idx_type c2) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (c1 < 0 || c2 < 0 || c1 >= len || c2 >= len) { @@ -135,9 +135,9 @@ FloatRowVector FloatRowVector::append (const FloatRowVector& a) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); octave_idx_type nc_insert = len; - FloatRowVector retval (len + a.length ()); + FloatRowVector retval (len + a.numel ()); retval.insert (*this, 0); retval.insert (a, nc_insert); return retval; @@ -194,7 +194,7 @@ { FloatRowVector retval; - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); octave_idx_type a_nr = a.rows (); octave_idx_type a_nc = a.cols (); @@ -229,7 +229,7 @@ float FloatRowVector::min (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0; @@ -245,7 +245,7 @@ float FloatRowVector::max (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len == 0) return 0; @@ -263,7 +263,7 @@ { // int field_width = os.precision () + 7; - for (octave_idx_type i = 0; i < a.length (); i++) + for (octave_idx_type i = 0; i < a.numel (); i++) os << " " /* setw (field_width) */ << a.elem (i); return os; } @@ -271,7 +271,7 @@ std::istream& operator >> (std::istream& is, FloatRowVector& a) { - octave_idx_type len = a.length (); + octave_idx_type len = a.numel (); if (len > 0) { @@ -313,9 +313,9 @@ { float retval = 0.0; - octave_idx_type len = v.length (); + octave_idx_type len = v.numel (); - octave_idx_type a_len = a.length (); + octave_idx_type a_len = a.numel (); if (len != a_len) gripe_nonconformant ("operator *", len, a_len); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/idx-vector.cc --- a/liboctave/array/idx-vector.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/idx-vector.cc Sat May 30 03:14:07 2015 +0100 @@ -405,7 +405,7 @@ { octave_idx_type *d = new octave_idx_type [len]; - octave_idx_type ntot = bnda.length (); + octave_idx_type ntot = bnda.numel (); octave_idx_type k = 0; for (octave_idx_type i = 0; i < ntot; i++) diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/array/intNDArray.cc --- a/liboctave/array/intNDArray.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/array/intNDArray.cc Sat May 30 03:14:07 2015 +0100 @@ -39,7 +39,7 @@ { boolNDArray b (this->dims ()); - for (octave_idx_type i = 0; i < this->length (); i++) + for (octave_idx_type i = 0; i < this->numel (); i++) b.elem (i) = ! this->elem (i); return b; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/CmplxCHOL.cc --- a/liboctave/numeric/CmplxCHOL.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/CmplxCHOL.cc Sat May 30 03:14:07 2015 +0100 @@ -200,7 +200,7 @@ { octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { ComplexColumnVector utmp = u; @@ -220,7 +220,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { ComplexColumnVector utmp = u; @@ -242,7 +242,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () != n + 1) + if (u.numel () != n + 1) (*current_liboctave_error_handler) ("cholinsert: dimension mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("cholinsert: index out of range"); @@ -305,7 +305,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { init (chol_mat.hermitian () * chol_mat + ComplexMatrix (u) * ComplexMatrix (u).hermitian (), false); @@ -331,7 +331,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { if (singular (chol_mat)) info = 2; @@ -358,7 +358,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () != n + 1) + if (u.numel () != n + 1) (*current_liboctave_error_handler) ("cholinsert: dimension mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("cholinsert: index out of range"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/CmplxLU.cc --- a/liboctave/numeric/CmplxLU.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/CmplxLU.cc Sat May 30 03:14:07 2015 +0100 @@ -98,7 +98,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = l.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { ComplexColumnVector utmp = u; ComplexColumnVector vtmp = v; @@ -149,7 +149,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = l.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { ComplexColumnVector utmp = u; ComplexColumnVector vtmp = v; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/CmplxQR.cc --- a/liboctave/numeric/CmplxQR.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/CmplxQR.cc Sat May 30 03:14:07 2015 +0100 @@ -212,7 +212,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = q.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { ComplexColumnVector utmp = u; ComplexColumnVector vtmp = v; @@ -259,7 +259,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = q.columns (); - if (u.length () != m) + if (u.numel () != m) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -292,14 +292,14 @@ Array jsi; Array js = j.sort (jsi, 0, ASCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); if (dups) (*current_liboctave_error_handler) ("qrinsert: duplicate index detected"); - else if (u.length () != m || u.columns () != nj) + else if (u.numel () != m || u.columns () != nj) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (nj > 0 && (js(0) < 0 || js(nj-1) > n)) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -317,7 +317,7 @@ } OCTAVE_LOCAL_BUFFER (double, rw, kmax); - for (volatile octave_idx_type i = 0; i < js.length (); i++) + for (volatile octave_idx_type i = 0; i < js.numel (); i++) { octave_idx_type ii = i; ComplexColumnVector utmp = u.column (jsi(i)); @@ -365,7 +365,7 @@ Array jsi; Array js = j.sort (jsi, 0, DESCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); @@ -377,7 +377,7 @@ else if (nj > 0) { OCTAVE_LOCAL_BUFFER (double, rw, k); - for (volatile octave_idx_type i = 0; i < js.length (); i++) + for (volatile octave_idx_type i = 0; i < js.numel (); i++) { octave_idx_type ii = i; F77_XFCN (zqrdec, ZQRDEC, (m, n - ii, k == m ? k : k - ii, @@ -405,7 +405,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = std::min (m, n); - if (! q.is_square () || u.length () != n) + if (! q.is_square () || u.numel () != n) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > m) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -477,7 +477,7 @@ octave_idx_type m = q.rows (); octave_idx_type n = r.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { init (q*r + ComplexMatrix (u) * ComplexMatrix (v).hermitian (), get_type ()); @@ -573,7 +573,7 @@ octave_idx_type m = q.rows (); octave_idx_type n = r.columns (); - if (u.length () != m) + if (u.numel () != m) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -593,21 +593,21 @@ Array jsi; Array js = j.sort (jsi, 0, ASCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); if (dups) (*current_liboctave_error_handler) ("qrinsert: duplicate index detected"); - else if (u.length () != m || u.columns () != nj) + else if (u.numel () != m || u.columns () != nj) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (nj > 0 && (js(0) < 0 || js(nj-1) > n)) (*current_liboctave_error_handler) ("qrinsert: index out of range"); else if (nj > 0) { ComplexMatrix a = q*r; - for (octave_idx_type i = 0; i < js.length (); i++) + for (octave_idx_type i = 0; i < js.numel (); i++) a = ::insert_col (a, js(i), u.column (i)); init (a, get_type ()); } @@ -637,7 +637,7 @@ Array jsi; Array js = j.sort (jsi, 0, DESCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); @@ -649,7 +649,7 @@ else if (nj > 0) { ComplexMatrix a = q*r; - for (octave_idx_type i = 0; i < js.length (); i++) + for (octave_idx_type i = 0; i < js.numel (); i++) a = ::delete_col (a, js(i)); init (a, get_type ()); } @@ -663,7 +663,7 @@ octave_idx_type m = r.rows (); octave_idx_type n = r.columns (); - if (! q.is_square () || u.length () != n) + if (! q.is_square () || u.numel () != n) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > m) (*current_liboctave_error_handler) ("qrinsert: index out of range"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/DASPK.cc --- a/liboctave/numeric/DASPK.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/DASPK.cc Sat May 30 03:14:07 2015 +0100 @@ -91,7 +91,7 @@ if (ires >= 0) { - if (tmp_delta.length () == 0) + if (tmp_delta.numel () == 0) ires = -2; else { @@ -196,7 +196,7 @@ ColumnVector res = (*user_fun) (x, xdot, t, ires); - if (res.length () != x.length ()) + if (res.numel () != x.numel ()) { (*current_liboctave_error_handler) ("daspk: inconsistent sizes for state and residual vectors"); @@ -240,8 +240,8 @@ abs_tol = absolute_tolerance (); rel_tol = relative_tolerance (); - octave_idx_type abs_tol_len = abs_tol.length (); - octave_idx_type rel_tol_len = rel_tol.length (); + octave_idx_type abs_tol_len = abs_tol.numel (); + octave_idx_type rel_tol_len = rel_tol.numel (); if (abs_tol_len == 1 && rel_tol_len == 1) { @@ -302,7 +302,7 @@ { Array ict = inequality_constraint_types (); - if (ict.length () == n) + if (ict.numel () == n) { for (octave_idx_type i = 0; i < n; i++) { @@ -347,7 +347,7 @@ Array av = algebraic_variables (); - if (av.length () == n) + if (av.numel () == n) { octave_idx_type lid; if (eiq == 0 || eiq == 2) @@ -387,7 +387,7 @@ Array av = algebraic_variables (); - if (av.length () == n) + if (av.numel () == n) { octave_idx_type lid; if (eiq == 0 || eiq == 2) @@ -406,7 +406,7 @@ { Array ich = initial_condition_heuristics (); - if (ich.length () == 6) + if (ich.numel () == 6) { iwork(31) = NINTbig (ich(0)); iwork(32) = NINTbig (ich(1)); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/DASRT.cc --- a/liboctave/numeric/DASRT.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/DASRT.cc Sat May 30 03:14:07 2015 +0100 @@ -87,7 +87,7 @@ ColumnVector tmp_fval = (*user_fsub) (tmp_state, tmp_deriv, t, ires); - if (tmp_fval.length () == 0) + if (tmp_fval.numel () == 0) ires = -2; else { @@ -182,7 +182,7 @@ if (user_csub) { ColumnVector tmp = (*user_csub) (x, t); - ng = tmp.length (); + ng = tmp.numel (); } else ng = 0; @@ -233,7 +233,7 @@ ColumnVector fval = (*user_fsub) (x, xdot, t, ires); - if (fval.length () != x.length ()) + if (fval.numel () != x.numel ()) { (*current_liboctave_error_handler) ("dasrt: inconsistent sizes for state and residual vectors"); @@ -290,8 +290,8 @@ abs_tol = absolute_tolerance (); rel_tol = relative_tolerance (); - octave_idx_type abs_tol_len = abs_tol.length (); - octave_idx_type rel_tol_len = rel_tol.length (); + octave_idx_type abs_tol_len = abs_tol.numel (); + octave_idx_type rel_tol_len = rel_tol.numel (); if (abs_tol_len == 1 && rel_tol_len == 1) { diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/DASSL.cc --- a/liboctave/numeric/DASSL.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/DASSL.cc Sat May 30 03:14:07 2015 +0100 @@ -84,7 +84,7 @@ if (ires >= 0) { - if (tmp_delta.length () == 0) + if (tmp_delta.numel () == 0) ires = -2; else { @@ -175,7 +175,7 @@ ColumnVector res = (*user_fun) (x, xdot, t, ires); - if (res.length () != x.length ()) + if (res.numel () != x.numel ()) { (*current_liboctave_error_handler) ("dassl: inconsistent sizes for state and residual vectors"); @@ -251,8 +251,8 @@ abs_tol = absolute_tolerance (); rel_tol = relative_tolerance (); - octave_idx_type abs_tol_len = abs_tol.length (); - octave_idx_type rel_tol_len = rel_tol.length (); + octave_idx_type abs_tol_len = abs_tol.numel (); + octave_idx_type rel_tol_len = rel_tol.numel (); if (abs_tol_len == 1 && rel_tol_len == 1) { diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/LSODE.cc --- a/liboctave/numeric/LSODE.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/LSODE.cc Sat May 30 03:14:07 2015 +0100 @@ -74,7 +74,7 @@ tmp_deriv = (*user_fun) (*tmp_x, time); - if (tmp_deriv.length () == 0) + if (tmp_deriv.numel () == 0) ierr = -1; else { @@ -208,7 +208,7 @@ ColumnVector xdot = (*user_fun) (x, t); - if (x.length () != xdot.length ()) + if (x.numel () != xdot.numel ()) { (*current_liboctave_error_handler) ("lsode: inconsistent sizes for state and derivative vectors"); @@ -224,7 +224,7 @@ rel_tol = relative_tolerance (); abs_tol = absolute_tolerance (); - octave_idx_type abs_tol_len = abs_tol.length (); + octave_idx_type abs_tol_len = abs_tol.numel (); if (abs_tol_len == 1) itol = 1; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/ODES.cc --- a/liboctave/numeric/ODES.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/ODES.cc Sat May 30 03:14:07 2015 +0100 @@ -31,7 +31,7 @@ ODES::initialize (const ColumnVector& xx, double tt) { base_diff_eqn::initialize (xx, tt); - xdot = ColumnVector (xx.length (), 0.0); + xdot = ColumnVector (xx.numel (), 0.0); } void @@ -39,6 +39,6 @@ const ColumnVector& xtheta) { base_diff_eqn::initialize (xx, tt); - xdot = ColumnVector (xx.length (), 0.0); + xdot = ColumnVector (xx.numel (), 0.0); theta = xtheta; } diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/ODES.h --- a/liboctave/numeric/ODES.h Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/ODES.h Sat May 30 03:14:07 2015 +0100 @@ -35,11 +35,11 @@ : base_diff_eqn (), ODESFunc (), xdot (), theta () { } ODES (const ColumnVector& s, double tm, ODESFunc& f) - : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), theta () { } + : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.numel (), 0.0), theta () { } ODES (const ColumnVector& s, const ColumnVector& xtheta, double tm, ODESFunc& f) - : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), + : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.numel (), 0.0), theta (xtheta) { } ODES (const ODES& a) diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/base-dae.h --- a/liboctave/numeric/base-dae.h Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/base-dae.h Sat May 30 03:14:07 2015 +0100 @@ -34,7 +34,7 @@ : base_diff_eqn (), xdot () { } base_diff_alg_eqn (const ColumnVector& xx, double tt) - : base_diff_eqn (xx, tt), xdot (xx.length (), 0.0) { } + : base_diff_eqn (xx, tt), xdot (xx.numel (), 0.0) { } base_diff_alg_eqn (const ColumnVector& xx, const ColumnVector& xxdot, double tt) @@ -58,7 +58,7 @@ void initialize (const ColumnVector& x0, double t0) { base_diff_eqn::initialize (x0, t0); - xdot = ColumnVector (x0.length (), 0.0); + xdot = ColumnVector (x0.numel (), 0.0); } void initialize (const ColumnVector& x0, const ColumnVector& xdot0, diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/base-lu.cc --- a/liboctave/numeric/base-lu.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/base-lu.cc Sat May 30 03:14:07 2015 +0100 @@ -129,7 +129,7 @@ for (octave_idx_type i = 0; i < a_nr; i++) pvt.xelem (i) = i; - for (octave_idx_type i = 0; i < ipvt.length (); i++) + for (octave_idx_type i = 0; i < ipvt.numel (); i++) { octave_idx_type k = ipvt.xelem (i); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/dbleCHOL.cc --- a/liboctave/numeric/dbleCHOL.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/dbleCHOL.cc Sat May 30 03:14:07 2015 +0100 @@ -205,7 +205,7 @@ { octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { ColumnVector utmp = u; @@ -225,7 +225,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { ColumnVector utmp = u; @@ -247,7 +247,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () != n + 1) + if (u.numel () != n + 1) (*current_liboctave_error_handler) ("cholinsert: dimension mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("cholinsert: index out of range"); @@ -309,7 +309,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { init (chol_mat.transpose () * chol_mat + Matrix (u) * Matrix (u).transpose (), false); @@ -335,7 +335,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { if (singular (chol_mat)) info = 2; @@ -361,7 +361,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () != n + 1) + if (u.numel () != n + 1) (*current_liboctave_error_handler) ("cholinsert: dimension mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("cholinsert: index out of range"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/dbleLU.cc --- a/liboctave/numeric/dbleLU.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/dbleLU.cc Sat May 30 03:14:07 2015 +0100 @@ -97,7 +97,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = l.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { ColumnVector utmp = u; ColumnVector vtmp = v; @@ -147,7 +147,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = l.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { ColumnVector utmp = u; ColumnVector vtmp = v; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/dbleQR.cc --- a/liboctave/numeric/dbleQR.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/dbleQR.cc Sat May 30 03:14:07 2015 +0100 @@ -213,7 +213,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = q.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { ColumnVector utmp = u; ColumnVector vtmp = v; @@ -257,7 +257,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = q.columns (); - if (u.length () != m) + if (u.numel () != m) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -290,14 +290,14 @@ Array jsi; Array js = j.sort (jsi, 0, ASCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); if (dups) (*current_liboctave_error_handler) ("qrinsert: duplicate index detected"); - else if (u.length () != m || u.columns () != nj) + else if (u.numel () != m || u.columns () != nj) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (nj > 0 && (js(0) < 0 || js(nj-1) > n)) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -315,7 +315,7 @@ } OCTAVE_LOCAL_BUFFER (double, w, kmax); - for (volatile octave_idx_type i = 0; i < js.length (); i++) + for (volatile octave_idx_type i = 0; i < js.numel (); i++) { octave_idx_type ii = i; ColumnVector utmp = u.column (jsi(i)); @@ -363,7 +363,7 @@ Array jsi; Array js = j.sort (jsi, 0, DESCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); @@ -375,7 +375,7 @@ else if (nj > 0) { OCTAVE_LOCAL_BUFFER (double, w, k); - for (volatile octave_idx_type i = 0; i < js.length (); i++) + for (volatile octave_idx_type i = 0; i < js.numel (); i++) { octave_idx_type ii = i; F77_XFCN (dqrdec, DQRDEC, (m, n - ii, k == m ? k : k - ii, @@ -403,7 +403,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = std::min (m, n); - if (! q.is_square () || u.length () != n) + if (! q.is_square () || u.numel () != n) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > m) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -473,7 +473,7 @@ octave_idx_type m = q.rows (); octave_idx_type n = r.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { init (q*r + Matrix (u) * Matrix (v).transpose (), get_type ()); } @@ -568,7 +568,7 @@ octave_idx_type m = q.rows (); octave_idx_type n = r.columns (); - if (u.length () != m) + if (u.numel () != m) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -588,21 +588,21 @@ Array jsi; Array js = j.sort (jsi, 0, ASCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); if (dups) (*current_liboctave_error_handler) ("qrinsert: duplicate index detected"); - else if (u.length () != m || u.columns () != nj) + else if (u.numel () != m || u.columns () != nj) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (nj > 0 && (js(0) < 0 || js(nj-1) > n)) (*current_liboctave_error_handler) ("qrinsert: index out of range"); else if (nj > 0) { Matrix a = q*r; - for (octave_idx_type i = 0; i < js.length (); i++) + for (octave_idx_type i = 0; i < js.numel (); i++) a = ::insert_col (a, js(i), u.column (i)); init (a, get_type ()); } @@ -632,7 +632,7 @@ Array jsi; Array js = j.sort (jsi, 0, DESCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); @@ -644,7 +644,7 @@ else if (nj > 0) { Matrix a = q*r; - for (octave_idx_type i = 0; i < js.length (); i++) + for (octave_idx_type i = 0; i < js.numel (); i++) a = ::delete_col (a, js(i)); init (a, get_type ()); } @@ -658,7 +658,7 @@ octave_idx_type m = r.rows (); octave_idx_type n = r.columns (); - if (! q.is_square () || u.length () != n) + if (! q.is_square () || u.numel () != n) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > m) (*current_liboctave_error_handler) ("qrinsert: index out of range"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/eigs-base.cc --- a/liboctave/numeric/eigs-base.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/eigs-base.cc Sat May 30 03:14:07 2015 +0100 @@ -445,7 +445,7 @@ { if (cholB) { - if (permB.length ()) + if (permB.numel ()) { SparseMatrix tmp(n,n,n); for (octave_idx_type i = 0; i < n; i++) @@ -541,7 +541,7 @@ const double *pB = permB.fortran_vec (); double *p = AminusSigmaB.fortran_vec (); - if (permB.length ()) + if (permB.numel ()) { for (octave_idx_type j = 0; j < b.cols (); j++) @@ -609,7 +609,7 @@ { if (cholB) { - if (permB.length ()) + if (permB.numel ()) { SparseMatrix tmp(n,n,n); for (octave_idx_type i = 0; i < n; i++) @@ -705,7 +705,7 @@ const double *pB = permB.fortran_vec (); Complex *p = AminusSigmaB.fortran_vec (); - if (permB.length ()) + if (permB.numel ()) { for (octave_idx_type j = 0; j < b.cols (); j++) @@ -829,10 +829,10 @@ return -1; } - if (have_b && cholB && permB.length () != 0) + if (have_b && cholB && permB.numel () != 0) { // Check the we really have a permutation vector - if (permB.length () != n) + if (permB.numel () != n) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); @@ -880,7 +880,7 @@ { bt = b; b = b.transpose (); - if (permB.length () == 0) + if (permB.numel () == 0) { permB = ColumnVector (n); for (octave_idx_type i = 0; i < n; i++) @@ -1153,10 +1153,10 @@ return -1; } - if (have_b && cholB && permB.length () != 0) + if (have_b && cholB && permB.numel () != 0) { // Check the we really have a permutation vector - if (permB.length () != n) + if (permB.numel () != n) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); return -1; @@ -1743,10 +1743,10 @@ return -1; } - if (have_b && cholB && permB.length () != 0) + if (have_b && cholB && permB.numel () != 0) { // Check the we really have a permutation vector - if (permB.length () != n) + if (permB.numel () != n) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); @@ -1794,7 +1794,7 @@ { bt = b; b = b.transpose (); - if (permB.length () == 0) + if (permB.numel () == 0) { permB = ColumnVector (n); for (octave_idx_type i = 0; i < n; i++) @@ -2116,10 +2116,10 @@ return -1; } - if (have_b && cholB && permB.length () != 0) + if (have_b && cholB && permB.numel () != 0) { // Check that we really have a permutation vector - if (permB.length () != n) + if (permB.numel () != n) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); return -1; @@ -2811,10 +2811,10 @@ return -1; } - if (have_b && cholB && permB.length () != 0) + if (have_b && cholB && permB.numel () != 0) { // Check the we really have a permutation vector - if (permB.length () != n) + if (permB.numel () != n) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); @@ -2862,7 +2862,7 @@ { bt = b; b = b.hermitian (); - if (permB.length () == 0) + if (permB.numel () == 0) { permB = ColumnVector (n); for (octave_idx_type i = 0; i < n; i++) @@ -3136,10 +3136,10 @@ return -1; } - if (have_b && cholB && permB.length () != 0) + if (have_b && cholB && permB.numel () != 0) { // Check that we really have a permutation vector - if (permB.length () != n) + if (permB.numel () != n) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); return -1; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/fCmplxCHOL.cc --- a/liboctave/numeric/fCmplxCHOL.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/fCmplxCHOL.cc Sat May 30 03:14:07 2015 +0100 @@ -200,7 +200,7 @@ { octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { FloatComplexColumnVector utmp = u; @@ -220,7 +220,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { FloatComplexColumnVector utmp = u; @@ -243,7 +243,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () != n + 1) + if (u.numel () != n + 1) (*current_liboctave_error_handler) ("cholinsert: dimension mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("cholinsert: index out of range"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/fCmplxLU.cc --- a/liboctave/numeric/fCmplxLU.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/fCmplxLU.cc Sat May 30 03:14:07 2015 +0100 @@ -98,7 +98,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = l.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { FloatComplexColumnVector utmp = u; FloatComplexColumnVector vtmp = v; @@ -150,7 +150,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = l.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { FloatComplexColumnVector utmp = u; FloatComplexColumnVector vtmp = v; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/fCmplxQR.cc --- a/liboctave/numeric/fCmplxQR.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/fCmplxQR.cc Sat May 30 03:14:07 2015 +0100 @@ -216,7 +216,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = q.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { FloatComplexColumnVector utmp = u; FloatComplexColumnVector vtmp = v; @@ -265,7 +265,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = q.columns (); - if (u.length () != m) + if (u.numel () != m) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -299,14 +299,14 @@ Array jsi; Array js = j.sort (jsi, 0, ASCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); if (dups) (*current_liboctave_error_handler) ("qrinsert: duplicate index detected"); - else if (u.length () != m || u.columns () != nj) + else if (u.numel () != m || u.columns () != nj) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (nj > 0 && (js(0) < 0 || js(nj-1) > n)) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -324,7 +324,7 @@ } OCTAVE_LOCAL_BUFFER (float, rw, kmax); - for (volatile octave_idx_type i = 0; i < js.length (); i++) + for (volatile octave_idx_type i = 0; i < js.numel (); i++) { octave_idx_type ii = i; F77_XFCN (cqrinc, CQRINC, (m, n + ii, std::min (kmax, k + ii), @@ -371,7 +371,7 @@ Array jsi; Array js = j.sort (jsi, 0, DESCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); @@ -383,7 +383,7 @@ else if (nj > 0) { OCTAVE_LOCAL_BUFFER (float, rw, k); - for (volatile octave_idx_type i = 0; i < js.length (); i++) + for (volatile octave_idx_type i = 0; i < js.numel (); i++) { octave_idx_type ii = i; F77_XFCN (cqrdec, CQRDEC, (m, n - ii, k == m ? k : k - ii, @@ -411,7 +411,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = std::min (m, n); - if (! q.is_square () || u.length () != n) + if (! q.is_square () || u.numel () != n) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > m) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -484,7 +484,7 @@ octave_idx_type m = q.rows (); octave_idx_type n = r.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { init (q*r + FloatComplexMatrix (u) * FloatComplexMatrix (v).hermitian (), get_type ()); @@ -582,7 +582,7 @@ octave_idx_type m = q.rows (); octave_idx_type n = r.columns (); - if (u.length () != m) + if (u.numel () != m) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -603,21 +603,21 @@ Array jsi; Array js = j.sort (jsi, 0, ASCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); if (dups) (*current_liboctave_error_handler) ("qrinsert: duplicate index detected"); - else if (u.length () != m || u.columns () != nj) + else if (u.numel () != m || u.columns () != nj) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (nj > 0 && (js(0) < 0 || js(nj-1) > n)) (*current_liboctave_error_handler) ("qrinsert: index out of range"); else if (nj > 0) { FloatComplexMatrix a = q*r; - for (octave_idx_type i = 0; i < js.length (); i++) + for (octave_idx_type i = 0; i < js.numel (); i++) a = ::insert_col (a, js(i), u.column (i)); init (a, get_type ()); } @@ -647,7 +647,7 @@ Array jsi; Array js = j.sort (jsi, 0, DESCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); @@ -659,7 +659,7 @@ else if (nj > 0) { FloatComplexMatrix a = q*r; - for (octave_idx_type i = 0; i < js.length (); i++) + for (octave_idx_type i = 0; i < js.numel (); i++) a = ::delete_col (a, js(i)); init (a, get_type ()); } @@ -673,7 +673,7 @@ octave_idx_type m = r.rows (); octave_idx_type n = r.columns (); - if (! q.is_square () || u.length () != n) + if (! q.is_square () || u.numel () != n) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > m) (*current_liboctave_error_handler) ("qrinsert: index out of range"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/floatCHOL.cc --- a/liboctave/numeric/floatCHOL.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/floatCHOL.cc Sat May 30 03:14:07 2015 +0100 @@ -205,7 +205,7 @@ { octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { FloatColumnVector utmp = u; @@ -225,7 +225,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { FloatColumnVector utmp = u; @@ -247,7 +247,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () != n + 1) + if (u.numel () != n + 1) (*current_liboctave_error_handler) ("cholinsert: dimension mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("cholinsert: index out of range"); @@ -309,7 +309,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { init (chol_mat.transpose () * chol_mat + FloatMatrix (u) * FloatMatrix (u).transpose (), false); @@ -335,7 +335,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () == n) + if (u.numel () == n) { if (singular (chol_mat)) info = 2; @@ -361,7 +361,7 @@ octave_idx_type n = chol_mat.rows (); - if (u.length () != n + 1) + if (u.numel () != n + 1) (*current_liboctave_error_handler) ("cholinsert: dimension mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("cholinsert: index out of range"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/floatLU.cc --- a/liboctave/numeric/floatLU.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/floatLU.cc Sat May 30 03:14:07 2015 +0100 @@ -97,7 +97,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = l.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { FloatColumnVector utmp = u; FloatColumnVector vtmp = v; @@ -149,7 +149,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = l.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { FloatColumnVector utmp = u; FloatColumnVector vtmp = v; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/floatQR.cc --- a/liboctave/numeric/floatQR.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/floatQR.cc Sat May 30 03:14:07 2015 +0100 @@ -211,7 +211,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = q.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { FloatColumnVector utmp = u; FloatColumnVector vtmp = v; @@ -255,7 +255,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = q.columns (); - if (u.length () != m) + if (u.numel () != m) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -288,14 +288,14 @@ Array jsi; Array js = j.sort (jsi, 0, ASCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); if (dups) (*current_liboctave_error_handler) ("qrinsert: duplicate index detected"); - else if (u.length () != m || u.columns () != nj) + else if (u.numel () != m || u.columns () != nj) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (nj > 0 && (js(0) < 0 || js(nj-1) > n)) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -313,7 +313,7 @@ } OCTAVE_LOCAL_BUFFER (float, w, kmax); - for (volatile octave_idx_type i = 0; i < js.length (); i++) + for (volatile octave_idx_type i = 0; i < js.numel (); i++) { octave_idx_type ii = i; FloatColumnVector utmp = u.column (jsi(i)); @@ -361,7 +361,7 @@ Array jsi; Array js = j.sort (jsi, 0, DESCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); @@ -373,7 +373,7 @@ else if (nj > 0) { OCTAVE_LOCAL_BUFFER (float, w, k); - for (volatile octave_idx_type i = 0; i < js.length (); i++) + for (volatile octave_idx_type i = 0; i < js.numel (); i++) { octave_idx_type ii = i; F77_XFCN (sqrdec, SQRDEC, (m, n - ii, k == m ? k : k - ii, @@ -401,7 +401,7 @@ octave_idx_type n = r.columns (); octave_idx_type k = std::min (m, n); - if (! q.is_square () || u.length () != n) + if (! q.is_square () || u.numel () != n) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > m) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -471,7 +471,7 @@ octave_idx_type m = q.rows (); octave_idx_type n = r.columns (); - if (u.length () == m && v.length () == n) + if (u.numel () == m && v.numel () == n) { init (q*r + FloatMatrix (u) * FloatMatrix (v).transpose (), get_type ()); } @@ -566,7 +566,7 @@ octave_idx_type m = q.rows (); octave_idx_type n = r.columns (); - if (u.length () != m) + if (u.numel () != m) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > n) (*current_liboctave_error_handler) ("qrinsert: index out of range"); @@ -586,21 +586,21 @@ Array jsi; Array js = j.sort (jsi, 0, ASCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); if (dups) (*current_liboctave_error_handler) ("qrinsert: duplicate index detected"); - else if (u.length () != m || u.columns () != nj) + else if (u.numel () != m || u.columns () != nj) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (nj > 0 && (js(0) < 0 || js(nj-1) > n)) (*current_liboctave_error_handler) ("qrinsert: index out of range"); else if (nj > 0) { FloatMatrix a = q*r; - for (octave_idx_type i = 0; i < js.length (); i++) + for (octave_idx_type i = 0; i < js.numel (); i++) a = ::insert_col (a, js(i), u.column (i)); init (a, get_type ()); } @@ -630,7 +630,7 @@ Array jsi; Array js = j.sort (jsi, 0, DESCENDING); - octave_idx_type nj = js.length (); + octave_idx_type nj = js.numel (); bool dups = false; for (octave_idx_type i = 0; i < nj - 1; i++) dups = dups && js(i) == js(i+1); @@ -642,7 +642,7 @@ else if (nj > 0) { FloatMatrix a = q*r; - for (octave_idx_type i = 0; i < js.length (); i++) + for (octave_idx_type i = 0; i < js.numel (); i++) a = ::delete_col (a, js(i)); init (a, get_type ()); } @@ -656,7 +656,7 @@ octave_idx_type m = r.rows (); octave_idx_type n = r.columns (); - if (! q.is_square () || u.length () != n) + if (! q.is_square () || u.numel () != n) (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch"); else if (j < 0 || j > m) (*current_liboctave_error_handler) ("qrinsert: index out of range"); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/lo-specfun.cc --- a/liboctave/numeric/lo-specfun.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/lo-specfun.cc Sat May 30 03:14:07 2015 +0100 @@ -1277,8 +1277,8 @@ const ComplexColumnVector& x, bool scaled, Array& ierr) { - octave_idx_type nr = x.length (); - octave_idx_type nc = alpha.length (); + octave_idx_type nr = x.numel (); + octave_idx_type nc = alpha.numel (); ComplexMatrix retval (nr, nc); @@ -1888,8 +1888,8 @@ const FloatComplexColumnVector& x, bool scaled, Array& ierr) { - octave_idx_type nr = x.length (); - octave_idx_type nc = alpha.length (); + octave_idx_type nr = x.numel (); + octave_idx_type nc = alpha.numel (); FloatComplexMatrix retval (nr, nc); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/oct-rand.cc --- a/liboctave/numeric/oct-rand.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/oct-rand.cc Sat May 30 03:14:07 2015 +0100 @@ -690,7 +690,7 @@ void octave_rand::set_internal_state (const ColumnVector& s) { - octave_idx_type len = s.length (); + octave_idx_type len = s.numel (); octave_idx_type n = len < MT_N + 1 ? len : MT_N + 1; OCTAVE_LOCAL_BUFFER (uint32_t, tmp, MT_N + 1); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/oct-spparms.cc --- a/liboctave/numeric/oct-spparms.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/oct-spparms.cc Sat May 30 03:14:07 2015 +0100 @@ -177,7 +177,7 @@ bool octave_sparse_params::do_set_vals (const NDArray& vals) { - octave_idx_type len = vals.length (); + octave_idx_type len = vals.numel (); if (len > OCTAVE_SPARSE_CONTROLS_SIZE) { diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/numeric/sparse-base-chol.cc --- a/liboctave/numeric/sparse-base-chol.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/numeric/sparse-base-chol.cc Sat May 30 03:14:07 2015 +0100 @@ -280,7 +280,7 @@ MatrixType mattype (MatrixType::Upper); chol_type linv = L ().hermitian ().inverse (mattype, info, rcond2, 1, 0); - if (perms.length () == n) + if (perms.numel () == n) { p_type Qc = Q (); retval = Qc * linv * linv.hermitian () * Qc.transpose (); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/operators/mx-inlines.cc --- a/liboctave/operators/mx-inlines.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/operators/mx-inlines.cc Sat May 30 03:14:07 2015 +0100 @@ -371,7 +371,7 @@ if (dx == dy) { Array r (dx); - op (r.length (), r.fortran_vec (), x.data (), y.data ()); + op (r.numel (), r.fortran_vec (), x.data (), y.data ()); return r; } else if (is_valid_bsxfun (opname, dx, dy)) @@ -391,7 +391,7 @@ void (*op) (size_t, R *, const X *, Y) throw ()) { Array r (x.dims ()); - op (r.length (), r.fortran_vec (), x.data (), y); + op (r.numel (), r.fortran_vec (), x.data (), y); return r; } @@ -401,7 +401,7 @@ void (*op) (size_t, R *, X, const Y *) throw ()) { Array r (y.dims ()); - op (r.length (), r.fortran_vec (), x, y.data ()); + op (r.numel (), r.fortran_vec (), x, y.data ()); return r; } @@ -416,7 +416,7 @@ dim_vector dx = x.dims (); if (dr == dx) { - op (r.length (), r.fortran_vec (), x.data ()); + op (r.numel (), r.fortran_vec (), x.data ()); } else if (is_valid_inplace_bsxfun (opname, dr, dx)) { @@ -432,7 +432,7 @@ do_ms_inplace_op (Array& r, const X& x, void (*op) (size_t, R *, X) throw ()) { - op (r.length (), r.fortran_vec (), x); + op (r.numel (), r.fortran_vec (), x); return r; } diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/system/file-ops.cc --- a/liboctave/system/file-ops.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/system/file-ops.cc Sat May 30 03:14:07 2015 +0100 @@ -152,7 +152,7 @@ { for (size_t i = 0; i < s_len; i++) { - for (int j = 0; j < prefixes.length (); j++) + for (int j = 0; j < prefixes.numel (); j++) { size_t pfx_len = prefixes[j].length (); @@ -187,7 +187,7 @@ if (! suffixes.empty ()) { - for (int j = 0; j < suffixes.length (); j++) + for (int j = 0; j < suffixes.numel (); j++) { size_t sfx_len = suffixes[j].length (); @@ -346,7 +346,7 @@ { string_vector retval; - int n = names.length (); + int n = names.numel (); retval.resize (n); @@ -580,7 +580,7 @@ { string_vector dirlist = dir.read (); - for (octave_idx_type i = 0; i < dirlist.length (); i++) + for (octave_idx_type i = 0; i < dirlist.numel (); i++) { octave_quit (); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/util/glob-match.h --- a/liboctave/util/glob-match.h Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/util/glob-match.h Sat May 30 03:14:07 2015 +0100 @@ -72,7 +72,7 @@ Array match (const string_vector& str) const { - int n = str.length (); + int n = str.numel (); Array retval (dim_vector (n, 1)); diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/util/kpse.cc --- a/liboctave/util/kpse.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/util/kpse.cc Sat May 30 03:14:07 2015 +0100 @@ -427,7 +427,7 @@ gnulib::fputs (" (nil)\n", stderr); else { - int len = ret.length (); + int len = ret.numel (); for (int i = 0; i < len; i++) { gnulib::putc (' ', stderr); @@ -704,7 +704,7 @@ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH) || log_file) { /* FILENAMES should never be null, but safety doesn't hurt. */ - for (int e = 0; e < filenames.length () && ! filenames[e].empty (); e++) + for (int e = 0; e < filenames.numel () && ! filenames[e].empty (); e++) { std::string filename = filenames[e]; @@ -1010,7 +1010,7 @@ { const std::string dir = STR_LLIST (*dirs_elt); - int len = names.length (); + int len = names.numel (); for (int i = 0; i < len && !done; i++) { std::string name = names[i]; @@ -1076,7 +1076,7 @@ { gnulib::fputs ("start find_first_of ((", stderr); - int len = names.length (); + int len = names.numel (); for (int i = 0; i < len; i++) { @@ -1090,7 +1090,7 @@ path.c_str (), must_exist); } - for (int i = 0; i < names.length (); i++) + for (int i = 0; i < names.numel (); i++) { std::string name = names[i]; @@ -1125,7 +1125,7 @@ { gnulib::fputs ("find_first_of (", stderr); - int len = names.length (); + int len = names.numel (); for (int i = 0; i < len; i++) { @@ -1337,7 +1337,7 @@ string_vector expansions = brace_expand (elt); - for (int i = 0; i < expansions.length (); i++) + for (int i = 0; i < expansions.numel (); i++) { /* Do $ and ~ expansion on each element. */ std::string x = kpse_expand (expansions[i]); @@ -1511,8 +1511,8 @@ result = arr1; else { - int len1 = arr1.length (); - int len2 = arr2.length (); + int len1 = arr1.numel (); + int len2 = arr2.numel (); result = string_vector (len1 * len2); @@ -1886,7 +1886,7 @@ extra couple of hash lookups matter -- they don't -- but rather because we want to return NULL in this case, so path_search can know to do a disk search. */ - for (int e = 0; ! relevant && e < db_dir_list.length (); e++) + for (int e = 0; ! relevant && e < db_dir_list.numel (); e++) relevant = elt_in_db (db_dir_list[e], path_elt); if (! relevant) @@ -1897,14 +1897,14 @@ aliases = hash_lookup (alias_db, name); /* Push aliases up by one and insert the original name at the front. */ - int len = aliases.length (); + int len = aliases.numel (); aliases.resize (len+1); for (int i = len; i > 0; i--) aliases[i] = aliases[i - 1]; aliases[0] = name; done = false; - len = aliases.length (); + len = aliases.numel (); for (int i = 0; i < len && !done; i++) { std::string atry = aliases[i]; @@ -1916,7 +1916,7 @@ example, if we have .../cx/cmr10.300pk and .../ricoh/cmr10.300pk, and the path looks like .../cx, we don't want the ricoh file. */ - int db_dirs_len = db_dirs.length (); + int db_dirs_len = db_dirs.numel (); for (int j = 0; j < db_dirs_len && !done; j++) { std::string db_file = db_dirs[j] + atry; @@ -1946,7 +1946,7 @@ and shouldn't hurt. The upshot is that if one of the aliases actually exists, we use that. */ - int aliases_len = aliases.length (); + int aliases_len = aliases.numel (); for (int k = 1; k < aliases_len && found.empty (); k++) { diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/util/lo-regexp.cc --- a/liboctave/util/lo-regexp.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/util/lo-regexp.cc Sat May 30 03:14:07 2015 +0100 @@ -434,11 +434,11 @@ Array regexp::is_match (const string_vector& buffer) { - octave_idx_type len = buffer.length (); + octave_idx_type len = buffer.numel (); Array retval (dim_vector (len, 1)); - for (octave_idx_type i = 0; i < buffer.length (); i++) + for (octave_idx_type i = 0; i < buffer.numel (); i++) retval(i) = is_match (buffer(i)); return retval; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/util/oct-glob.cc --- a/liboctave/util/oct-glob.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/util/oct-glob.cc Sat May 30 03:14:07 2015 +0100 @@ -51,7 +51,7 @@ octave_fnmatch (const string_vector& pat, const std::string& str, int fnmatch_flags) { - int npat = pat.length (); + int npat = pat.numel (); const char *cstr = str.c_str (); @@ -67,7 +67,7 @@ { string_vector retval; - int npat = pat.length (); + int npat = pat.numel (); int k = 0; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/util/pathsearch.cc --- a/liboctave/util/pathsearch.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/util/pathsearch.cc Sat May 30 03:14:07 2015 +0100 @@ -79,7 +79,7 @@ if (initialized) { - int len = pv.length (); + int len = pv.numel (); int nmax = len > 32 ? len : 32; diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/util/str-vec.cc --- a/liboctave/util/str-vec.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/util/str-vec.cc Sat May 30 03:14:07 2015 +0100 @@ -108,7 +108,7 @@ { // Don't use Array::sort () to allow sorting in place. octave_sort lsort; - lsort.sort (Array::fortran_vec (), length ()); + lsort.sort (Array::fortran_vec (), numel ()); if (make_uniq) uniq (); @@ -118,7 +118,7 @@ string_vector& string_vector::uniq (void) { - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -139,7 +139,7 @@ string_vector& string_vector::append (const std::string& s) { - octave_idx_type len = length (); + octave_idx_type len = numel (); resize (len + 1); @@ -151,8 +151,8 @@ string_vector& string_vector::append (const string_vector& sv) { - octave_idx_type len = length (); - octave_idx_type sv_len = sv.length (); + octave_idx_type len = numel (); + octave_idx_type sv_len = sv.numel (); octave_idx_type new_len = len + sv_len; resize (new_len); @@ -168,7 +168,7 @@ { std::string retval; - octave_idx_type len = length (); + octave_idx_type len = numel (); if (len > 0) { @@ -186,7 +186,7 @@ char ** string_vector::c_str_vec (void) const { - octave_idx_type len = length (); + octave_idx_type len = numel (); char **retval = new char * [len + 1]; @@ -218,7 +218,7 @@ // Compute the maximum name length. octave_idx_type max_name_length = 0; - octave_idx_type total_names = length (); + octave_idx_type total_names = numel (); if (total_names == 0) { diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/util/str-vec.h --- a/liboctave/util/str-vec.h Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/util/str-vec.h Sat May 30 03:14:07 2015 +0100 @@ -70,11 +70,11 @@ ~string_vector (void) { } - bool empty (void) const { return length () == 0; } + bool empty (void) const { return numel () == 0; } octave_idx_type max_length (void) const { - octave_idx_type n = length (); + octave_idx_type n = numel (); octave_idx_type longest = 0; for (octave_idx_type i = 0; i < n; i++) diff -r 83792dd9bcc1 -r a9574e3c6e9e liboctave/util/url-transfer.cc --- a/liboctave/util/url-transfer.cc Tue May 26 21:07:42 2015 -0700 +++ b/liboctave/util/url-transfer.cc Sat May 30 03:14:07 2015 +0100 @@ -82,7 +82,7 @@ string_vector sv = list (); - for (octave_idx_type i = 0; i < sv.length (); i++) + for (octave_idx_type i = 0; i < sv.numel (); i++) { time_t ftime; bool fisdir; @@ -153,7 +153,7 @@ { string_vector files = dirlist.read (); - for (octave_idx_type i = 0; i < files.length (); i++) + for (octave_idx_type i = 0; i < files.numel (); i++) { std::string file = files (i);