diff libinterp/corefcn/cellfun.cc @ 21660:53728df3e4c9

maint: for clarity, call ndims() rather than length() on dimension vectors. * ov-re-sparse.cc, QtHandlesUtils.cc, __lin_interpn__.cc, bsxfun.cc, cellfun.cc, data.cc, dot.cc, ellipj.cc, fft.cc, fft2.cc, fftn.cc, filter.cc, gl-render.cc, graphics.cc, mex.cc, oct-map.h, sub2ind.cc, symtab.cc, tril.cc, typecast.cc, utils.cc, variables.cc, ov-base-diag.cc, ov-base-int.cc, ov-base.cc, ov-base.h, ov-bool-mat.cc, ov-bool-sparse.cc, ov-cell.cc, ov-class.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-intx.h, ov-java.cc, ov-lazy-idx.cc, ov-re-mat.cc, ov-str-mat.cc, ov-struct.cc, ov.cc, pt-arg-list.cc, pt-mat.cc, Array-util.cc, Array.cc, Array.h, CNDArray.cc, CSparse.cc, Sparse.cc, Sparse.h, dNDArray.cc, dSparse.cc, dim-vector.cc, dim-vector.h, fCNDArray.cc, fNDArray.cc, idx-vector.cc, bsxfun.h, oct-fftw.cc, mx-inlines.cc, lo-array-errwarn.cc, lo-array-gripes.cc: For clarity, call ndims() rather than length() on dimension vectors.
author Rik <rik@octave.org>
date Mon, 02 May 2016 08:53:18 -0700
parents 6fab85c1538f
children aba2e6293dd8
line wrap: on
line diff
--- a/libinterp/corefcn/cellfun.cc	Fri Apr 29 16:40:38 2016 -0400
+++ b/libinterp/corefcn/cellfun.cc	Mon May 02 08:53:18 2016 -0700
@@ -194,7 +194,7 @@
       for (octave_idx_type count = 0; count < k; count++)
         {
           dim_vector dv = f_args.elem (count).dims ();
-          if (d < dv.length ())
+          if (d < dv.ndims ())
             result(count) = static_cast<double> (dv(d));
           else
             result(count) = 1.0;
@@ -1604,11 +1604,11 @@
                     Array<int>& perm)
 {
   int dvl = dimv.numel ();
-  int maxd = dv.length ();
+  int maxd = dv.ndims ();
   celldv = dv;
   for (int i = 0; i < dvl; i++)
     maxd = std::max (maxd, dimv(i));
-  if (maxd > dv.length ())
+  if (maxd > dv.ndims ())
     celldv.resize (maxd, 1);
   arraydv = celldv;
 
@@ -1852,7 +1852,7 @@
       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;
+      octave_idx_type r = i < dv.ndims () ? dv(i) : 1;
 
       if (s != r)
         error ("mat2cell: mismatch on dimension %d (%d != %d)", i+1, r, s);
@@ -2209,7 +2209,7 @@
   else
     {
       const dim_vector dv = array.dims ();
-      int ndims = dv.length ();
+      int ndims = dv.ndims ();
       if (dim < 0)
         dim = dv.first_non_singleton ();
       ndims = std::max (ndims, dim + 1);
@@ -2331,7 +2331,7 @@
       octave_idx_type n = lb.numel ();
       retcell = Cell (1, n);
       const dim_vector dv = x.dims ();
-      int ndims = dv.length ();
+      int ndims = dv.ndims ();
       if (dim < 0)
         dim = dv.first_non_singleton ();
       ndims = std::max (ndims, dim + 1);