changeset 30135:606652e9f446

maint: use "m_" prefix for member variables in class octave_base_diag. * ov-base-diag.cc, ov-base-diag.h, ov-cx-diag.cc, ov-flt-cx-diag.cc, ov-flt-re-diag.cc, ov-re-diag.cc: Use "m_" prefix for member variables in class octave_base_diag.
author Rik <rik@octave.org>
date Tue, 07 Sep 2021 16:07:34 -0700
parents 71d738ed015d
children 598517b10959
files libinterp/octave-value/ov-base-diag.cc libinterp/octave-value/ov-base-diag.h libinterp/octave-value/ov-cx-diag.cc libinterp/octave-value/ov-flt-cx-diag.cc libinterp/octave-value/ov-flt-re-diag.cc libinterp/octave-value/ov-re-diag.cc
diffstat 6 files changed, 145 insertions(+), 145 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-base-diag.cc	Tue Sep 07 16:00:42 2021 -0700
+++ b/libinterp/octave-value/ov-base-diag.cc	Tue Sep 07 16:07:34 2021 -0700
@@ -79,7 +79,7 @@
 octave_base_diag<DMT,MT>::diag (octave_idx_type k) const
 {
   octave_value retval;
-  if (matrix.rows () == 1 || matrix.cols () == 1)
+  if (m_matrix.rows () == 1 || m_matrix.cols () == 1)
     {
       // Rather odd special case.  This is a row or column vector
       // represented as a diagonal matrix with a single nonzero entry, but
@@ -87,14 +87,14 @@
       // inputs.
       if (k == 0)
         // Returns Diag2Array<T> with nnz <= 1.
-        retval = matrix.build_diag_matrix ();
+        retval = m_matrix.build_diag_matrix ();
       else
         // Returns Array<T> matrix
-        retval = matrix.array_value ().diag (k);
+        retval = m_matrix.array_value ().diag (k);
     }
   else
     // Returns Array<T> vector
-    retval = matrix.extract_diag (k);
+    retval = m_matrix.extract_diag (k);
   return retval;
 }
 
@@ -116,16 +116,16 @@
 
           if (idx0.is_scalar () && idx1.is_scalar ())
             {
-              retval = matrix.checkelem (idx0(0), idx1(0));
+              retval = m_matrix.checkelem (idx0(0), idx1(0));
             }
           else
             {
-              octave_idx_type m = idx0.length (matrix.rows ());
-              octave_idx_type n = idx1.length (matrix.columns ());
+              octave_idx_type m = idx0.length (m_matrix.rows ());
+              octave_idx_type n = idx1.length (m_matrix.columns ());
               if (idx0.is_colon_equiv (m) && idx1.is_colon_equiv (n)
-                  && m <= matrix.rows () && n <= matrix.rows ())
+                  && m <= m_matrix.rows () && n <= m_matrix.rows ())
                 {
-                  DMT rm (matrix);
+                  DMT rm (m_matrix);
                   rm.resize (m, n);
                   retval = rm;
                 }
@@ -182,7 +182,7 @@
               {
                 octave::idx_vector ind = jdx(0).index_vector ();
                 k = 1;
-                dim_vector dv (matrix.rows (), matrix.cols ());
+                dim_vector dv (m_matrix.rows (), m_matrix.cols ());
                 Array<octave::idx_vector> ivec = ind2sub (dv, ind);
                 octave::idx_vector i0 = ivec(0);
                 octave::idx_vector i1 = ivec(1);
@@ -190,11 +190,11 @@
                 if (i0(0) == i1(0)
                     && chk_valid_scalar (rhs, val))
                   {
-                    matrix.dgelem (i0(0)) = val;
+                    m_matrix.dgelem (i0(0)) = val;
                     retval = this;
                     this->m_count++;
                     // invalidate cache
-                    dense_cache = octave_value ();
+                    m_dense_cache = octave_value ();
                   }
               }
             catch (octave::index_exception& ie)
@@ -215,14 +215,14 @@
                 k = 1;
                 octave::idx_vector i1 = jdx(1).index_vector ();
                 if (i0(0) == i1(0)
-                    && i0(0) < matrix.rows () && i1(0) < matrix.cols ()
+                    && i0(0) < m_matrix.rows () && i1(0) < m_matrix.cols ()
                     && chk_valid_scalar (rhs, val))
                   {
-                    matrix.dgelem (i0(0)) = val;
+                    m_matrix.dgelem (i0(0)) = val;
                     retval = this;
                     this->m_count++;
                     // invalidate cache
-                    dense_cache = octave_value ();
+                    m_dense_cache = octave_value ();
                   }
               }
             catch (octave::index_exception& ie)
@@ -267,7 +267,7 @@
   octave_value retval;
   if (dv.ndims () == 2)
     {
-      DMT rm (matrix);
+      DMT rm (m_matrix);
       rm.resize (dv(0), dv(1));
       retval = rm;
     }
@@ -285,7 +285,7 @@
     {
       warn_array_as_logical (dims ());
       // Throw error if any NaN or NA by calling is_true().
-      octave_value (matrix.extract_diag ()).is_true ();
+      octave_value (m_matrix.extract_diag ()).is_true ();
       return false;                 // > 1x1 diagonal always has zeros
     }
   else
@@ -309,7 +309,7 @@
 
   if (helper_iscomplex (el_type ()) && ! force_conversion)
     warn_implicit_conversion ("Octave:imag-to-real",
-                              "complex matrix", "real scalar");
+                              "complex m_matrix", "real scalar");
 
   if (isempty ())
     err_invalid_conversion (type_name (), "real scalar");
@@ -317,7 +317,7 @@
   warn_implicit_conversion ("Octave:array-to-scalar",
                             type_name (), "real scalar");
 
-  return helper_getreal (el_type (matrix (0, 0)));
+  return helper_getreal (el_type (m_matrix (0, 0)));
 }
 
 template <typename DMT, typename MT>
@@ -328,7 +328,7 @@
 
   if (helper_iscomplex (el_type ()) && ! force_conversion)
     warn_implicit_conversion ("Octave:imag-to-real",
-                              "complex matrix", "real scalar");
+                              "complex m_matrix", "real scalar");
 
   if (! (numel () > 0))
     err_invalid_conversion (type_name (), "real scalar");
@@ -336,7 +336,7 @@
   warn_implicit_conversion ("Octave:array-to-scalar",
                             type_name (), "real scalar");
 
-  return helper_getreal (el_type (matrix (0, 0)));
+  return helper_getreal (el_type (m_matrix (0, 0)));
 }
 
 template <typename DMT, typename MT>
@@ -349,7 +349,7 @@
   warn_implicit_conversion ("Octave:array-to-scalar",
                             type_name (), "complex scalar");
 
-  return matrix(0, 0);
+  return m_matrix(0, 0);
 }
 
 template <typename DMT, typename MT>
@@ -366,7 +366,7 @@
   warn_implicit_conversion ("Octave:array-to-scalar",
                             type_name (), "complex scalar");
 
-  retval = matrix (0, 0);
+  retval = m_matrix (0, 0);
 
   return retval;
 }
@@ -485,7 +485,7 @@
                                          octave_idx_type j) const
 {
   std::ostringstream buf;
-  octave_print_internal (buf, fmt, matrix(i,j));
+  octave_print_internal (buf, fmt, m_matrix(i,j));
   return buf.str ();
 }
 
@@ -493,10 +493,10 @@
 bool
 octave_base_diag<DMT, MT>::save_ascii (std::ostream& os)
 {
-  os << "# rows: " << matrix.rows () << "\n"
-     << "# columns: " << matrix.columns () << "\n";
+  os << "# rows: " << m_matrix.rows () << "\n"
+     << "# columns: " << m_matrix.columns () << "\n";
 
-  os << matrix.extract_diag ();
+  os << m_matrix.extract_diag ();
 
   return true;
 }
@@ -517,17 +517,17 @@
   is >> tmp;
 
   if (! is)
-    error ("load: failed to load diagonal matrix constant");
+    error ("load: failed to load diagonal m_matrix constant");
 
   // This is a little tricky, as we have the Matrix type, but
   // not ColumnVector type.  We need to help the compiler get
   // through the inheritance tree.
   typedef typename DMT::element_type el_type;
-  matrix = DMT (MDiagArray2<el_type> (MArray<el_type> (tmp)));
-  matrix.resize (r, c);
+  m_matrix = DMT (MDiagArray2<el_type> (MArray<el_type> (tmp)));
+  m_matrix.resize (r, c);
 
   // Invalidate cache.  Probably not necessary, but safe.
-  dense_cache = octave_value ();
+  m_dense_cache = octave_value ();
 
   return true;
 }
@@ -537,7 +537,7 @@
 octave_base_diag<DMT, MT>::print_raw (std::ostream& os,
                                       bool pr_as_read_syntax) const
 {
-  return octave_print_internal (os, matrix, pr_as_read_syntax,
+  return octave_print_internal (os, m_matrix, pr_as_read_syntax,
                                 current_print_indent_level ());
 }
 
@@ -579,7 +579,7 @@
 octave_base_diag<DMT, MT>::print_info (std::ostream& os,
                                        const std::string& prefix) const
 {
-  matrix.print_info (os, prefix);
+  m_matrix.print_info (os, prefix);
 }
 
 // FIXME: this function is duplicated in octave_base_matrix<T>.  Could
@@ -589,18 +589,18 @@
 void
 octave_base_diag<DMT, MT>::short_disp (std::ostream& os) const
 {
-  if (matrix.isempty ())
+  if (m_matrix.isempty ())
     os << "[]";
-  else if (matrix.ndims () == 2)
+  else if (m_matrix.ndims () == 2)
     {
       // FIXME: should this be configurable?
       octave_idx_type max_elts = 10;
       octave_idx_type elts = 0;
 
-      octave_idx_type nel = matrix.numel ();
+      octave_idx_type nel = m_matrix.numel ();
 
-      octave_idx_type nr = matrix.rows ();
-      octave_idx_type nc = matrix.columns ();
+      octave_idx_type nr = m_matrix.rows ();
+      octave_idx_type nc = m_matrix.columns ();
 
       os << '[';
 
@@ -609,7 +609,7 @@
           for (octave_idx_type j = 0; j < nc; j++)
             {
               std::ostringstream buf;
-              octave_print_internal (buf, matrix(i,j));
+              octave_print_internal (buf, m_matrix(i,j));
               std::string tmp = buf.str ();
               std::size_t pos = tmp.find_first_not_of (' ');
               if (pos != std::string::npos)
@@ -641,14 +641,14 @@
 octave_value
 octave_base_diag<DMT, MT>::fast_elem_extract (octave_idx_type n) const
 {
-  if (n < matrix.numel ())
+  if (n < m_matrix.numel ())
     {
-      octave_idx_type nr = matrix.rows ();
+      octave_idx_type nr = m_matrix.rows ();
 
       octave_idx_type r = n % nr;
       octave_idx_type c = n / nr;
 
-      return octave_value (matrix.elem (r, c));
+      return octave_value (m_matrix.elem (r, c));
     }
   else
     return octave_value ();
@@ -658,8 +658,8 @@
 octave_value
 octave_base_diag<DMT, MT>::to_dense (void) const
 {
-  if (! dense_cache.is_defined ())
-    dense_cache = MT (matrix);
+  if (! m_dense_cache.is_defined ())
+    m_dense_cache = MT (m_matrix);
 
-  return dense_cache;
+  return m_dense_cache;
 }
--- a/libinterp/octave-value/ov-base-diag.h	Tue Sep 07 16:00:42 2021 -0700
+++ b/libinterp/octave-value/ov-base-diag.h	Tue Sep 07 16:07:34 2021 -0700
@@ -51,20 +51,20 @@
 public:
 
   octave_base_diag (void)
-    : octave_base_value (), matrix (), dense_cache () { }
+    : octave_base_value (), m_matrix (), m_dense_cache () { }
 
   octave_base_diag (const DMT& m)
-    : octave_base_value (), matrix (m), dense_cache ()
+    : octave_base_value (), m_matrix (m), m_dense_cache ()
   { }
 
   octave_base_diag (const octave_base_diag& m)
-    : octave_base_value (), matrix (m.matrix), dense_cache () { }
+    : octave_base_value (), m_matrix (m.m_matrix), m_dense_cache () { }
 
   ~octave_base_diag (void) = default;
 
-  std::size_t byte_size (void) const { return matrix.byte_size (); }
+  std::size_t byte_size (void) const { return m_matrix.byte_size (); }
 
-  octave_value squeeze (void) const { return matrix; }
+  octave_value squeeze (void) const { return m_matrix; }
 
   octave_value full_value (void) const { return to_dense (); }
 
@@ -87,7 +87,7 @@
   subsasgn (const std::string& type, const std::list<octave_value_list>& idx,
             const octave_value& rhs);
 
-  dim_vector dims (void) const { return matrix.dims (); }
+  dim_vector dims (void) const { return m_matrix.dims (); }
 
   octave_idx_type nnz (void) const { return diag ().nnz (); }
 
@@ -99,7 +99,7 @@
     if (vec.numel () == 2
         && ((vec.xelem (0) == 1 && vec.xelem (1) == 0)
             || (vec.xelem (0) == 0 && vec.xelem (1) == 1)))
-      return DMT (matrix);
+      return DMT (m_matrix);
     else
       return to_dense ().permute (vec, inv);
   }
@@ -107,8 +107,8 @@
   OCTINTERP_API octave_value
   resize (const dim_vector& dv, bool fill = false) const;
 
-  octave_value all (int dim = 0) const { return MT (matrix).all (dim); }
-  octave_value any (int dim = 0) const { return MT (matrix).any (dim); }
+  octave_value all (int dim = 0) const { return MT (m_matrix).all (dim); }
+  octave_value any (int dim = 0) const { return MT (m_matrix).any (dim); }
 
   MatrixType matrix_type (void) const { return MatrixType::Diagonal; }
   MatrixType matrix_type (const MatrixType&) const
@@ -249,7 +249,7 @@
 
 protected:
 
-  DMT matrix;
+  DMT m_matrix;
 
   OCTINTERP_API octave_value to_dense (void) const;
 
@@ -258,7 +258,7 @@
 
 private:
 
-  mutable octave_value dense_cache;
+  mutable octave_value m_dense_cache;
 
 };
 
--- a/libinterp/octave-value/ov-cx-diag.cc	Tue Sep 07 16:00:42 2021 -0700
+++ b/libinterp/octave-value/ov-cx-diag.cc	Tue Sep 07 16:07:34 2021 -0700
@@ -41,7 +41,7 @@
 template class octave_base_diag<ComplexDiagMatrix, ComplexMatrix>;
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_complex_diag_matrix,
-                                     "complex diagonal matrix", "double");
+                                     "complex diagonal m_matrix", "double");
 
 static octave_base_value *
 default_numeric_conversion_function (const octave_base_value& a)
@@ -83,9 +83,9 @@
 {
   octave_base_value *retval = nullptr;
 
-  if (matrix.nelem () == 1)
+  if (m_matrix.nelem () == 1)
     {
-      retval = new octave_complex (matrix (0, 0));
+      retval = new octave_complex (m_matrix (0, 0));
       octave_base_value *rv2 = retval->try_narrowing_conversion ();
       if (rv2)
         {
@@ -93,9 +93,9 @@
           retval = rv2;
         }
     }
-  else if (matrix.all_elements_are_real ())
+  else if (m_matrix.all_elements_are_real ())
     {
-      return new octave_diag_matrix (::real (matrix));
+      return new octave_diag_matrix (::real (m_matrix));
     }
 
   return retval;
@@ -108,9 +108,9 @@
 
   if (! force_conversion)
     warn_implicit_conversion ("Octave:imag-to-real",
-                              type_name (), "real matrix");
+                              type_name (), "real m_matrix");
 
-  retval = ::real (matrix);
+  retval = ::real (m_matrix);
 
   return retval;
 }
@@ -122,9 +122,9 @@
 
   if (! force_conversion)
     warn_implicit_conversion ("Octave:imag-to-real",
-                              type_name (), "real matrix");
+                              type_name (), "real m_matrix");
 
-  retval = ::real (matrix);
+  retval = ::real (m_matrix);
 
   return retval;
 }
@@ -132,25 +132,25 @@
 ComplexDiagMatrix
 octave_complex_diag_matrix::complex_diag_matrix_value (bool) const
 {
-  return matrix;
+  return m_matrix;
 }
 
 FloatComplexDiagMatrix
 octave_complex_diag_matrix::float_complex_diag_matrix_value (bool) const
 {
-  return FloatComplexDiagMatrix (matrix);
+  return FloatComplexDiagMatrix (m_matrix);
 }
 
 octave_value
 octave_complex_diag_matrix::as_double (void) const
 {
-  return matrix;
+  return m_matrix;
 }
 
 octave_value
 octave_complex_diag_matrix::as_single (void) const
 {
-  return FloatComplexDiagMatrix (matrix);
+  return FloatComplexDiagMatrix (m_matrix);
 }
 
 octave_value
@@ -159,19 +159,19 @@
   switch (umap)
     {
     case umap_abs:
-      return matrix.abs ();
+      return m_matrix.abs ();
     case umap_real:
-      return ::real (matrix);
+      return ::real (m_matrix);
     case umap_conj:
-      return ::conj (matrix);
+      return ::conj (m_matrix);
     case umap_imag:
-      return ::imag (matrix);
+      return ::imag (m_matrix);
     case umap_sqrt:
       {
         ComplexColumnVector tmp
-          = matrix.extract_diag ().map<Complex> (std::sqrt);
+          = m_matrix.extract_diag ().map<Complex> (std::sqrt);
         ComplexDiagMatrix retval (tmp);
-        retval.resize (matrix.rows (), matrix.columns ());
+        retval.resize (m_matrix.rows (), m_matrix.columns ());
         return retval;
       }
     default:
@@ -183,12 +183,12 @@
 octave_complex_diag_matrix::save_binary (std::ostream& os, bool save_as_floats)
 {
 
-  int32_t r = matrix.rows ();
-  int32_t c = matrix.cols ();
+  int32_t r = m_matrix.rows ();
+  int32_t c = m_matrix.cols ();
   os.write (reinterpret_cast<char *> (&r), 4);
   os.write (reinterpret_cast<char *> (&c), 4);
 
-  ComplexMatrix m = ComplexMatrix (matrix.extract_diag ());
+  ComplexMatrix m = ComplexMatrix (m_matrix.extract_diag ());
   save_type st = LS_DOUBLE;
   if (save_as_floats)
     {
@@ -200,7 +200,7 @@
       else
         st = LS_FLOAT;
     }
-  else if (matrix.length () > 4096) // FIXME: make this configurable.
+  else if (m_matrix.length () > 4096) // FIXME: make this configurable.
     {
       double max_val, min_val;
       if (m.all_integers (max_val, min_val))
@@ -239,7 +239,7 @@
   if (! is)
     return false;
 
-  matrix = m;
+  m_matrix = m;
 
   return true;
 }
--- a/libinterp/octave-value/ov-flt-cx-diag.cc	Tue Sep 07 16:00:42 2021 -0700
+++ b/libinterp/octave-value/ov-flt-cx-diag.cc	Tue Sep 07 16:07:34 2021 -0700
@@ -40,7 +40,7 @@
 template class octave_base_diag<FloatComplexDiagMatrix, FloatComplexMatrix>;
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_float_complex_diag_matrix,
-                                     "float complex diagonal matrix", "single");
+                                     "float complex diagonal m_matrix", "single");
 
 static octave_base_value *
 default_numeric_conversion_function (const octave_base_value& a)
@@ -63,9 +63,9 @@
 {
   octave_base_value *retval = nullptr;
 
-  if (matrix.nelem () == 1)
+  if (m_matrix.nelem () == 1)
     {
-      retval = new octave_float_complex (matrix (0, 0));
+      retval = new octave_float_complex (m_matrix (0, 0));
       octave_base_value *rv2 = retval->try_narrowing_conversion ();
       if (rv2)
         {
@@ -73,9 +73,9 @@
           retval = rv2;
         }
     }
-  else if (matrix.all_elements_are_real ())
+  else if (m_matrix.all_elements_are_real ())
     {
-      return new octave_float_diag_matrix (::real (matrix));
+      return new octave_float_diag_matrix (::real (m_matrix));
     }
 
   return retval;
@@ -88,9 +88,9 @@
 
   if (! force_conversion)
     warn_implicit_conversion ("Octave:imag-to-real",
-                              type_name (), "real matrix");
+                              type_name (), "real m_matrix");
 
-  retval = ::real (matrix);
+  retval = ::real (m_matrix);
 
   return retval;
 }
@@ -102,9 +102,9 @@
 
   if (! force_conversion)
     warn_implicit_conversion ("Octave:imag-to-real",
-                              type_name (), "real matrix");
+                              type_name (), "real m_matrix");
 
-  retval = ::real (matrix);
+  retval = ::real (m_matrix);
 
   return retval;
 }
@@ -112,25 +112,25 @@
 ComplexDiagMatrix
 octave_float_complex_diag_matrix::complex_diag_matrix_value (bool) const
 {
-  return ComplexDiagMatrix (matrix);
+  return ComplexDiagMatrix (m_matrix);
 }
 
 FloatComplexDiagMatrix
 octave_float_complex_diag_matrix::float_complex_diag_matrix_value (bool) const
 {
-  return matrix;
+  return m_matrix;
 }
 
 octave_value
 octave_float_complex_diag_matrix::as_double (void) const
 {
-  return ComplexDiagMatrix (matrix);
+  return ComplexDiagMatrix (m_matrix);
 }
 
 octave_value
 octave_float_complex_diag_matrix::as_single (void) const
 {
-  return matrix;
+  return m_matrix;
 }
 
 octave_value
@@ -139,19 +139,19 @@
   switch (umap)
     {
     case umap_abs:
-      return matrix.abs ();
+      return m_matrix.abs ();
     case umap_real:
-      return ::real (matrix);
+      return ::real (m_matrix);
     case umap_conj:
-      return ::conj (matrix);
+      return ::conj (m_matrix);
     case umap_imag:
-      return ::imag (matrix);
+      return ::imag (m_matrix);
     case umap_sqrt:
       {
-        FloatComplexColumnVector tmp = matrix.extract_diag ().map<FloatComplex>
+        FloatComplexColumnVector tmp = m_matrix.extract_diag ().map<FloatComplex>
                                        (std::sqrt);
         FloatComplexDiagMatrix retval (tmp);
-        retval.resize (matrix.rows (), matrix.columns ());
+        retval.resize (m_matrix.rows (), m_matrix.columns ());
         return retval;
       }
     default:
@@ -164,14 +164,14 @@
                                                bool /* save_as_floats */)
 {
 
-  int32_t r = matrix.rows ();
-  int32_t c = matrix.cols ();
+  int32_t r = m_matrix.rows ();
+  int32_t c = m_matrix.cols ();
   os.write (reinterpret_cast<char *> (&r), 4);
   os.write (reinterpret_cast<char *> (&c), 4);
 
-  FloatComplexMatrix m = FloatComplexMatrix (matrix.extract_diag ());
+  FloatComplexMatrix m = FloatComplexMatrix (m_matrix.extract_diag ());
   save_type st = LS_FLOAT;
-  if (matrix.length () > 4096) // FIXME: make this configurable.
+  if (m_matrix.length () > 4096) // FIXME: make this configurable.
     {
       float max_val, min_val;
       if (m.all_integers (max_val, min_val))
@@ -209,7 +209,7 @@
   if (! is)
     return false;
 
-  matrix = m;
+  m_matrix = m;
 
   return true;
 }
--- a/libinterp/octave-value/ov-flt-re-diag.cc	Tue Sep 07 16:00:42 2021 -0700
+++ b/libinterp/octave-value/ov-flt-re-diag.cc	Tue Sep 07 16:07:34 2021 -0700
@@ -39,7 +39,7 @@
 template class octave_base_diag<FloatDiagMatrix, FloatMatrix>;
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_float_diag_matrix,
-                                     "float diagonal matrix", "single");
+                                     "float diagonal m_matrix", "single");
 
 static octave_base_value *
 default_numeric_conversion_function (const octave_base_value& a)
@@ -62,8 +62,8 @@
 {
   octave_base_value *retval = nullptr;
 
-  if (matrix.nelem () == 1)
-    retval = new octave_float_scalar (matrix (0, 0));
+  if (m_matrix.nelem () == 1)
+    retval = new octave_float_scalar (m_matrix (0, 0));
 
   return retval;
 }
@@ -71,37 +71,37 @@
 DiagMatrix
 octave_float_diag_matrix::diag_matrix_value (bool) const
 {
-  return DiagMatrix (matrix);
+  return DiagMatrix (m_matrix);
 }
 
 FloatDiagMatrix
 octave_float_diag_matrix::float_diag_matrix_value (bool) const
 {
-  return matrix;
+  return m_matrix;
 }
 
 ComplexDiagMatrix
 octave_float_diag_matrix::complex_diag_matrix_value (bool) const
 {
-  return ComplexDiagMatrix (matrix);
+  return ComplexDiagMatrix (m_matrix);
 }
 
 FloatComplexDiagMatrix
 octave_float_diag_matrix::float_complex_diag_matrix_value (bool) const
 {
-  return FloatComplexDiagMatrix (matrix);
+  return FloatComplexDiagMatrix (m_matrix);
 }
 
 octave_value
 octave_float_diag_matrix::as_double (void) const
 {
-  return DiagMatrix (matrix);
+  return DiagMatrix (m_matrix);
 }
 
 octave_value
 octave_float_diag_matrix::as_single (void) const
 {
-  return matrix;
+  return m_matrix;
 }
 
 octave_value
@@ -158,18 +158,18 @@
   switch (umap)
     {
     case umap_abs:
-      return matrix.abs ();
+      return m_matrix.abs ();
     case umap_real:
     case umap_conj:
-      return matrix;
+      return m_matrix;
     case umap_imag:
-      return DiagMatrix (matrix.rows (), matrix.cols (), 0.0);
+      return DiagMatrix (m_matrix.rows (), m_matrix.cols (), 0.0);
     case umap_sqrt:
       {
-        FloatComplexColumnVector tmp = matrix.extract_diag ().map<FloatComplex>
+        FloatComplexColumnVector tmp = m_matrix.extract_diag ().map<FloatComplex>
                                        (octave::math::rc_sqrt);
         FloatComplexDiagMatrix retval (tmp);
-        retval.resize (matrix.rows (), matrix.columns ());
+        retval.resize (m_matrix.rows (), m_matrix.columns ());
         return retval;
       }
     default:
@@ -182,14 +182,14 @@
                                        bool /* save_as_floats*/)
 {
 
-  int32_t r = matrix.rows ();
-  int32_t c = matrix.cols ();
+  int32_t r = m_matrix.rows ();
+  int32_t c = m_matrix.cols ();
   os.write (reinterpret_cast<char *> (&r), 4);
   os.write (reinterpret_cast<char *> (&c), 4);
 
-  FloatMatrix m = FloatMatrix (matrix.extract_diag ());
+  FloatMatrix m = FloatMatrix (m_matrix.extract_diag ());
   save_type st = LS_FLOAT;
-  if (matrix.length () > 8192) // FIXME: make this configurable.
+  if (m_matrix.length () > 8192) // FIXME: make this configurable.
     {
       float max_val, min_val;
       if (m.all_integers (max_val, min_val))
@@ -226,7 +226,7 @@
   if (! is)
     return false;
 
-  matrix = m;
+  m_matrix = m;
 
   return true;
 }
--- a/libinterp/octave-value/ov-re-diag.cc	Tue Sep 07 16:00:42 2021 -0700
+++ b/libinterp/octave-value/ov-re-diag.cc	Tue Sep 07 16:07:34 2021 -0700
@@ -39,7 +39,7 @@
 
 template class octave_base_diag<DiagMatrix, Matrix>;
 
-DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_diag_matrix, "diagonal matrix",
+DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_diag_matrix, "diagonal m_matrix",
                                      "double");
 
 static octave_base_value *
@@ -78,8 +78,8 @@
 {
   octave_base_value *retval = nullptr;
 
-  if (matrix.nelem () == 1)
-    retval = new octave_scalar (matrix (0, 0));
+  if (m_matrix.nelem () == 1)
+    retval = new octave_scalar (m_matrix (0, 0));
 
   return retval;
 }
@@ -93,7 +93,7 @@
   // This hack is to allow constructing permutation matrices using
   // eye(n)(p,:), eye(n)(:,q) && eye(n)(p,q) where p & q are permutation
   // vectors.
-  if (! resize_ok && idx.length () == 2 && matrix.is_multiple_of_identity (1))
+  if (! resize_ok && idx.length () == 2 && m_matrix.is_multiple_of_identity (1))
     {
       int k = 0;        // index we're accessing when index_vector throws
       try
@@ -102,8 +102,8 @@
           k = 1;
           octave::idx_vector idx1 = idx(1).index_vector ();
 
-          bool left = idx0.is_permutation (matrix.rows ());
-          bool right = idx1.is_permutation (matrix.cols ());
+          bool left = idx0.is_permutation (m_matrix.rows ());
+          bool right = idx1.is_permutation (m_matrix.cols ());
 
           if (left && right)
             {
@@ -139,37 +139,37 @@
 DiagMatrix
 octave_diag_matrix::diag_matrix_value (bool) const
 {
-  return matrix;
+  return m_matrix;
 }
 
 FloatDiagMatrix
 octave_diag_matrix::float_diag_matrix_value (bool) const
 {
-  return FloatDiagMatrix (matrix);
+  return FloatDiagMatrix (m_matrix);
 }
 
 ComplexDiagMatrix
 octave_diag_matrix::complex_diag_matrix_value (bool) const
 {
-  return ComplexDiagMatrix (matrix);
+  return ComplexDiagMatrix (m_matrix);
 }
 
 FloatComplexDiagMatrix
 octave_diag_matrix::float_complex_diag_matrix_value (bool) const
 {
-  return FloatComplexDiagMatrix (matrix);
+  return FloatComplexDiagMatrix (m_matrix);
 }
 
 octave_value
 octave_diag_matrix::as_double (void) const
 {
-  return matrix;
+  return m_matrix;
 }
 
 octave_value
 octave_diag_matrix::as_single (void) const
 {
-  return FloatDiagMatrix (matrix);
+  return FloatDiagMatrix (m_matrix);
 }
 
 octave_value
@@ -226,18 +226,18 @@
   switch (umap)
     {
     case umap_abs:
-      return matrix.abs ();
+      return m_matrix.abs ();
     case umap_real:
     case umap_conj:
-      return matrix;
+      return m_matrix;
     case umap_imag:
-      return DiagMatrix (matrix.rows (), matrix.cols (), 0.0);
+      return DiagMatrix (m_matrix.rows (), m_matrix.cols (), 0.0);
     case umap_sqrt:
       {
         ComplexColumnVector tmp;
-        tmp = matrix.extract_diag ().map<Complex> (octave::math::rc_sqrt);
+        tmp = m_matrix.extract_diag ().map<Complex> (octave::math::rc_sqrt);
         ComplexDiagMatrix retval (tmp);
-        retval.resize (matrix.rows (), matrix.columns ());
+        retval.resize (m_matrix.rows (), m_matrix.columns ());
         return retval;
       }
     default:
@@ -249,12 +249,12 @@
 octave_diag_matrix::save_binary (std::ostream& os, bool save_as_floats)
 {
 
-  int32_t r = matrix.rows ();
-  int32_t c = matrix.cols ();
+  int32_t r = m_matrix.rows ();
+  int32_t c = m_matrix.cols ();
   os.write (reinterpret_cast<char *> (&r), 4);
   os.write (reinterpret_cast<char *> (&c), 4);
 
-  Matrix m = Matrix (matrix.extract_diag ());
+  Matrix m = Matrix (m_matrix.extract_diag ());
   save_type st = LS_DOUBLE;
   if (save_as_floats)
     {
@@ -266,7 +266,7 @@
       else
         st = LS_FLOAT;
     }
-  else if (matrix.length () > 8192) // FIXME: make this configurable.
+  else if (m_matrix.length () > 8192) // FIXME: make this configurable.
     {
       double max_val, min_val;
       if (m.all_integers (max_val, min_val))
@@ -303,7 +303,7 @@
   if (! is)
     return false;
 
-  matrix = m;
+  m_matrix = m;
 
   return true;
 }