diff libinterp/corefcn/cellfun.cc @ 27666:3e8faed1b7d8

Remove wrapper template class NoAlias<T> (bug #56752) * liboctave/array/Array.h: remove template definition * libinterp/corefcn/cellfun.cc, libinterp/corefcn/data.cc, libinterp/corefcn/xpow.cc, libinterp/octave-value/ov-cell.cc, libinterp/octave-value/ov-cell.cc, libinterp/octave-value/ov-flt-re-mat.cc, libinterp/octave-value/ov-flt-re-mat.cc, liboctave/array/CMatrix.cc, liboctave/array/CRowVector.cc, liboctave/array/CRowVector.cc, liboctave/array/Sparse.cc, liboctave/array/dMatrix.cc, liboctave/array/dRowVector.cc, liboctave/array/fCMatrix.cc, liboctave/array/fCRowVector.cc, liboctave/array/fMatrix.cc, liboctave/array/fRowVector.cc: use xelem method explicitly instead of the NoAlias wrapper.
author Carlo de Falco <carlo.defalco@polimi.it>
date Mon, 30 Sep 2019 11:05:42 +0200
parents 3fec8e9fa2aa
children b442ec6dda5c
line wrap: on
line diff
--- a/libinterp/corefcn/cellfun.cc	Sun Nov 10 21:56:18 2019 +0100
+++ b/libinterp/corefcn/cellfun.cc	Mon Sep 30 11:05:42 2019 +0200
@@ -1925,7 +1925,7 @@
 static Cell
 do_mat2cell_2d (const Array2D& a, const Array<octave_idx_type> *d, int nd)
 {
-  NoAlias<Cell> retval;
+  Cell retval;
   assert (nd == 1 || nd == 2);
   assert (a.ndims () == 2);
 
@@ -1950,7 +1950,7 @@
       for (octave_idx_type i = 0; i < nidx; i++)
         {
           octave_idx_type u = l + d[ivec](i);
-          retval(i) = a.index (idx_vector (l, u));
+          retval.xelem (i) = a.index (idx_vector (l, u));
           l = u;
         }
     }
@@ -1968,7 +1968,7 @@
           {
             octave_quit ();
 
-            retval(i,j) = a.index (ridx[i], cidx[j]);
+            retval.xelem (i,j) = a.index (ridx[i], cidx[j]);
           }
     }
 
@@ -1982,7 +1982,7 @@
 Cell
 do_mat2cell_nd (const ArrayND& a, const Array<octave_idx_type> *d, int nd)
 {
-  NoAlias<Cell> retval;
+  Cell retval;
   assert (nd >= 1);
 
   if (mat2cell_mismatch (a.dims (), d, nd))
@@ -2011,7 +2011,7 @@
     }
 
   OCTAVE_LOCAL_BUFFER_INIT (octave_idx_type, ridx, nd, 0);
-  NoAlias< Array<idx_vector>> ra_idx
+  Array<idx_vector> ra_idx
     (dim_vector (1, std::max (nd, a.ndims ())), idx_vector::colon);
 
   for (octave_idx_type j = 0; j < retval.numel (); j++)
@@ -2019,9 +2019,9 @@
       octave_quit ();
 
       for (int i = 0; i < nd; i++)
-        ra_idx(i) = idx[i][ridx[i]];
+        ra_idx.xelem (i) = idx[i][ridx[i]];
 
-      retval(j) = a.index (ra_idx);
+      retval.xelem (j) = a.index (ra_idx);
 
       rdv.increment_index (ridx);
     }
@@ -2046,7 +2046,7 @@
 Cell
 do_mat2cell (octave_value& a, const Array<octave_idx_type> *d, int nd)
 {
-  NoAlias<Cell> retval;
+  Cell retval;
   assert (nd >= 1);
 
   if (mat2cell_mismatch (a.dims (), d, nd))
@@ -2085,7 +2085,7 @@
       for (int i = 0; i < nd; i++)
         ra_idx(i) = idx[i][ridx[i]];
 
-      retval(j) = a.do_index_op (ra_idx);
+      retval.xelem (j) = a.do_index_op (ra_idx);
 
       rdv.increment_index (ridx);
     }
@@ -2285,7 +2285,7 @@
                             || (dim == 1 && array.rows () == 1)))
     {
       for (octave_idx_type i = 0; i < n; i++)
-        retval(i) = array.index (idx_vector (lb(i) - 1, ub(i)));
+        retval.xelem (i) = array.index (idx_vector (lb(i) - 1, ub(i)));
     }
   else
     {
@@ -2300,7 +2300,7 @@
       for (octave_idx_type i = 0; i < n; i++)
         {
           idx(dim) = idx_vector (lb(i) - 1, ub(i));
-          retval(i) = array.index (idx);
+          retval.xelem (i) = array.index (idx);
         }
     }
 
@@ -2420,7 +2420,7 @@
       for (octave_idx_type i = 0; i < n; i++)
         {
           idx(dim) = Range (lb(i), ub(i));
-          retcell(i) = x.do_index_op (idx);
+          retcell.xelem (i) = x.do_index_op (idx);
         }
     }
 
@@ -2461,7 +2461,7 @@
 
   const Cell x = args(0).xcell_value ("cellindexmat: X must be a cell");
 
-  NoAlias<Cell> y (x.dims ());
+  Cell y (x.dims ());
   octave_idx_type nel = x.numel ();
   octave_value_list idx = args.slice (1, args.length () - 1);
 
@@ -2471,7 +2471,7 @@
 
       octave_value tmp = x(i);
 
-      y(i) = tmp.do_index_op (idx);
+      y.xelem (i) = tmp.do_index_op (idx);
     }
 
   return octave_value (y);