changeset 30073:1e277c6b6626

maint: rename schur member function from "unitary_matrix" to "unitary_schur_matrix" * schur.h: Rename schur member function from "unitary_matrix" to "unitary_schur_matrix". * schur.cc, sqrtm.cc, CMatrix.cc, dMatrix.cc, fCMatrix.cc, fMatrix.cc, schur.cc: Rename all occurrences of "unitary_matrix".
author Rik <rik@octave.org>
date Mon, 30 Aug 2021 09:45:47 -0700
parents 96a40641d86e
children 93f576a35b23
files libinterp/corefcn/schur.cc libinterp/corefcn/sqrtm.cc liboctave/array/CMatrix.cc liboctave/array/dMatrix.cc liboctave/array/fCMatrix.cc liboctave/array/fMatrix.cc liboctave/numeric/schur.cc liboctave/numeric/schur.h
diffstat 8 files changed, 76 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/schur.cc	Mon Aug 30 09:02:23 2021 -0700
+++ b/libinterp/corefcn/schur.cc	Mon Aug 30 09:45:47 2021 -0700
@@ -190,7 +190,7 @@
           else
             {
               math::schur<FloatMatrix> result (tmp, ord, true);
-              retval = ovl (result.unitary_matrix (),
+              retval = ovl (result.unitary_schur_matrix (),
                             result.schur_matrix ());
             }
         }
@@ -206,7 +206,7 @@
           else
             {
               math::schur<FloatComplexMatrix> result (ctmp, ord, true);
-              retval = ovl (result.unitary_matrix (),
+              retval = ovl (result.unitary_schur_matrix (),
                             mark_upper_triangular (result.schur_matrix ()));
             }
         }
@@ -225,7 +225,7 @@
           else
             {
               math::schur<Matrix> result (tmp, ord, true);
-              retval = ovl (result.unitary_matrix (),
+              retval = ovl (result.unitary_schur_matrix (),
                             result.schur_matrix ());
             }
         }
@@ -241,7 +241,7 @@
           else
             {
               math::schur<ComplexMatrix> result (ctmp, ord, true);
-              retval = ovl (result.unitary_matrix (),
+              retval = ovl (result.unitary_schur_matrix (),
                             mark_upper_triangular (result.schur_matrix ()));
             }
         }
@@ -309,7 +309,7 @@
       math::schur<FloatComplexMatrix> cs
         = math::rsf2csf<FloatComplexMatrix, FloatMatrix> (t, u);
 
-      return ovl (cs.unitary_matrix (), cs.schur_matrix ());
+      return ovl (cs.unitary_schur_matrix (), cs.schur_matrix ());
     }
   else
     {
@@ -319,7 +319,7 @@
       math::schur<ComplexMatrix> cs
         = math::rsf2csf<ComplexMatrix, Matrix> (t, u);
 
-      return ovl (cs.unitary_matrix (), cs.schur_matrix ());
+      return ovl (cs.unitary_schur_matrix (), cs.schur_matrix ());
     }
 }
 
--- a/libinterp/corefcn/sqrtm.cc	Mon Aug 30 09:02:23 2021 -0700
+++ b/libinterp/corefcn/sqrtm.cc	Mon Aug 30 09:45:47 2021 -0700
@@ -184,7 +184,7 @@
               {
                 ComplexSCHUR schur_fact (x, "", true);
                 x = schur_fact.schur_matrix ();
-                u = schur_fact.unitary_matrix ();
+                u = schur_fact.unitary_schur_matrix ();
               }
             while (0); // schur no longer needed.
 
--- a/liboctave/array/CMatrix.cc	Mon Aug 30 09:02:23 2021 -0700
+++ b/liboctave/array/CMatrix.cc	Mon Aug 30 09:45:47 2021 -0700
@@ -3233,10 +3233,10 @@
 
   // Transform c to new coordinates.
 
-  ComplexMatrix ua = as.unitary_matrix ();
+  ComplexMatrix ua = as.unitary_schur_matrix ();
   ComplexMatrix sch_a = as.schur_matrix ();
 
-  ComplexMatrix ub = bs.unitary_matrix ();
+  ComplexMatrix ub = bs.unitary_schur_matrix ();
   ComplexMatrix sch_b = bs.schur_matrix ();
 
   ComplexMatrix cx = ua.hermitian () * c * ub;
--- a/liboctave/array/dMatrix.cc	Mon Aug 30 09:02:23 2021 -0700
+++ b/liboctave/array/dMatrix.cc	Mon Aug 30 09:45:47 2021 -0700
@@ -2696,10 +2696,10 @@
 
   // Transform c to new coordinates.
 
-  Matrix ua = as.unitary_matrix ();
+  Matrix ua = as.unitary_schur_matrix ();
   Matrix sch_a = as.schur_matrix ();
 
-  Matrix ub = bs.unitary_matrix ();
+  Matrix ub = bs.unitary_schur_matrix ();
   Matrix sch_b = bs.schur_matrix ();
 
   Matrix cx = ua.transpose () * c * ub;
--- a/liboctave/array/fCMatrix.cc	Mon Aug 30 09:02:23 2021 -0700
+++ b/liboctave/array/fCMatrix.cc	Mon Aug 30 09:45:47 2021 -0700
@@ -3263,10 +3263,10 @@
 
   // Transform c to new coordinates.
 
-  FloatComplexMatrix ua = as.unitary_matrix ();
+  FloatComplexMatrix ua = as.unitary_schur_matrix ();
   FloatComplexMatrix sch_a = as.schur_matrix ();
 
-  FloatComplexMatrix ub = bs.unitary_matrix ();
+  FloatComplexMatrix ub = bs.unitary_schur_matrix ();
   FloatComplexMatrix sch_b = bs.schur_matrix ();
 
   FloatComplexMatrix cx = ua.hermitian () * c * ub;
--- a/liboctave/array/fMatrix.cc	Mon Aug 30 09:02:23 2021 -0700
+++ b/liboctave/array/fMatrix.cc	Mon Aug 30 09:45:47 2021 -0700
@@ -2706,10 +2706,10 @@
 
   // Transform c to new coordinates.
 
-  FloatMatrix ua = as.unitary_matrix ();
+  FloatMatrix ua = as.unitary_schur_matrix ();
   FloatMatrix sch_a = as.schur_matrix ();
 
-  FloatMatrix ub = bs.unitary_matrix ();
+  FloatMatrix ub = bs.unitary_schur_matrix ();
   FloatMatrix sch_b = bs.schur_matrix ();
 
   FloatMatrix cx = ua.transpose () * c * ub;
--- a/liboctave/numeric/schur.cc	Mon Aug 30 09:02:23 2021 -0700
+++ b/liboctave/numeric/schur.cc	Mon Aug 30 09:45:47 2021 -0700
@@ -99,7 +99,8 @@
 
     template <>
     OCTAVE_API F77_INT
-    schur<Matrix>::init (const Matrix& a, const std::string& ord, bool calc_unitary)
+    schur<Matrix>::init (const Matrix& a, const std::string& ord,
+                         bool calc_unitary)
     {
       F77_INT a_nr = to_f77_int (a.rows ());
       F77_INT a_nc = to_f77_int (a.cols ());
@@ -110,7 +111,7 @@
       if (a_nr == 0)
         {
           m_schur_mat.clear ();
-          m_unitary_mat.clear ();
+          m_unitary_schur_mat.clear ();
           return 0;
         }
 
@@ -128,7 +129,8 @@
 
       char ord_char = (ord.empty () ? 'U' : ord[0]);
 
-      if (ord_char == 'A' || ord_char == 'D' || ord_char == 'a' || ord_char == 'd')
+      if (ord_char == 'A' || ord_char == 'D'
+          || ord_char == 'a' || ord_char == 'd')
         sort = 'S';
 
       volatile double_selector selector = nullptr;
@@ -148,10 +150,10 @@
       m_schur_mat = a;
 
       if (calc_unitary)
-        m_unitary_mat.clear (n, n);
+        m_unitary_schur_mat.clear (n, n);
 
       double *s = m_schur_mat.fortran_vec ();
-      double *q = m_unitary_mat.fortran_vec ();
+      double *q = m_unitary_schur_mat.fortran_vec ();
 
       Array<double> wr (dim_vector (n, 1));
       double *pwr = wr.fortran_vec ();
@@ -197,7 +199,7 @@
       if (a_nr == 0)
         {
           m_schur_mat.clear ();
-          m_unitary_mat.clear ();
+          m_unitary_schur_mat.clear ();
           return 0;
         }
 
@@ -215,7 +217,8 @@
 
       char ord_char = (ord.empty () ? 'U' : ord[0]);
 
-      if (ord_char == 'A' || ord_char == 'D' || ord_char == 'a' || ord_char == 'd')
+      if (ord_char == 'A' || ord_char == 'D'
+          || ord_char == 'a' || ord_char == 'd')
         sort = 'S';
 
       volatile float_selector selector = nullptr;
@@ -235,10 +238,10 @@
       m_schur_mat = a;
 
       if (calc_unitary)
-        m_unitary_mat.clear (n, n);
+        m_unitary_schur_mat.clear (n, n);
 
       float *s = m_schur_mat.fortran_vec ();
-      float *q = m_unitary_mat.fortran_vec ();
+      float *q = m_unitary_schur_mat.fortran_vec ();
 
       Array<float> wr (dim_vector (n, 1));
       float *pwr = wr.fortran_vec ();
@@ -284,7 +287,7 @@
       if (a_nr == 0)
         {
           m_schur_mat.clear ();
-          m_unitary_mat.clear ();
+          m_unitary_schur_mat.clear ();
           return 0;
         }
 
@@ -302,7 +305,8 @@
 
       char ord_char = (ord.empty () ? 'U' : ord[0]);
 
-      if (ord_char == 'A' || ord_char == 'D' || ord_char == 'a' || ord_char == 'd')
+      if (ord_char == 'A' || ord_char == 'D'
+          || ord_char == 'a' || ord_char == 'd')
         sort = 'S';
 
       volatile complex_selector selector = nullptr;
@@ -320,10 +324,10 @@
 
       m_schur_mat = a;
       if (calc_unitary)
-        m_unitary_mat.clear (n, n);
+        m_unitary_schur_mat.clear (n, n);
 
       Complex *s = m_schur_mat.fortran_vec ();
-      Complex *q = m_unitary_mat.fortran_vec ();
+      Complex *q = m_unitary_schur_mat.fortran_vec ();
 
       Array<double> rwork (dim_vector (n, 1));
       double *prwork = rwork.fortran_vec ();
@@ -339,16 +343,17 @@
       Array<F77_INT> bwork (dim_vector (ntmp, 1));
       F77_INT *pbwork = bwork.fortran_vec ();
 
-      F77_XFCN (zgeesx, ZGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
-                                 F77_CONST_CHAR_ARG2 (&sort, 1),
-                                 selector,
-                                 F77_CONST_CHAR_ARG2 (&sense, 1),
-                                 n, F77_DBLE_CMPLX_ARG (s), n, sdim, F77_DBLE_CMPLX_ARG (pw),
-                                 F77_DBLE_CMPLX_ARG (q), n, rconde, rcondv,
-                                 F77_DBLE_CMPLX_ARG (pwork), lwork, prwork, pbwork, info
-                                 F77_CHAR_ARG_LEN (1)
-                                 F77_CHAR_ARG_LEN (1)
-                                 F77_CHAR_ARG_LEN (1)));
+      F77_XFCN (zgeesx, ZGEESX,
+                (F77_CONST_CHAR_ARG2 (&jobvs, 1),
+                 F77_CONST_CHAR_ARG2 (&sort, 1),
+                 selector,
+                 F77_CONST_CHAR_ARG2 (&sense, 1),
+                 n, F77_DBLE_CMPLX_ARG (s), n, sdim, F77_DBLE_CMPLX_ARG (pw),
+                 F77_DBLE_CMPLX_ARG (q), n, rconde, rcondv,
+                 F77_DBLE_CMPLX_ARG (pwork), lwork, prwork, pbwork, info
+                 F77_CHAR_ARG_LEN (1)
+                 F77_CHAR_ARG_LEN (1)
+                 F77_CHAR_ARG_LEN (1)));
 
       return info;
     }
@@ -371,8 +376,9 @@
           OCTAVE_LOCAL_BUFFER (double, c, n-1);
           OCTAVE_LOCAL_BUFFER (double, sx, n-1);
 
-          F77_XFCN (zrsf2csf, ZRSF2CSF, (n, F77_DBLE_CMPLX_ARG (s.fortran_vec ()),
-                                         F77_DBLE_CMPLX_ARG (u.fortran_vec ()), c, sx));
+          F77_XFCN (zrsf2csf, ZRSF2CSF,
+                    (n, F77_DBLE_CMPLX_ARG (s.fortran_vec ()),
+                     F77_DBLE_CMPLX_ARG (u.fortran_vec ()), c, sx));
         }
 
       return schur<ComplexMatrix> (s, u);
@@ -392,7 +398,7 @@
       if (a_nr == 0)
         {
           m_schur_mat.clear ();
-          m_unitary_mat.clear ();
+          m_unitary_schur_mat.clear ();
           return 0;
         }
 
@@ -410,7 +416,8 @@
 
       char ord_char = (ord.empty () ? 'U' : ord[0]);
 
-      if (ord_char == 'A' || ord_char == 'D' || ord_char == 'a' || ord_char == 'd')
+      if (ord_char == 'A' || ord_char == 'D'
+          || ord_char == 'a' || ord_char == 'd')
         sort = 'S';
 
       volatile float_complex_selector selector = nullptr;
@@ -428,10 +435,10 @@
 
       m_schur_mat = a;
       if (calc_unitary)
-        m_unitary_mat.clear (n, n);
+        m_unitary_schur_mat.clear (n, n);
 
       FloatComplex *s = m_schur_mat.fortran_vec ();
-      FloatComplex *q = m_unitary_mat.fortran_vec ();
+      FloatComplex *q = m_unitary_schur_mat.fortran_vec ();
 
       Array<float> rwork (dim_vector (n, 1));
       float *prwork = rwork.fortran_vec ();
@@ -447,16 +454,18 @@
       Array<F77_INT> bwork (dim_vector (ntmp, 1));
       F77_INT *pbwork = bwork.fortran_vec ();
 
-      F77_XFCN (cgeesx, CGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
-                                 F77_CONST_CHAR_ARG2 (&sort, 1),
-                                 selector,
-                                 F77_CONST_CHAR_ARG2 (&sense, 1),
-                                 n, F77_CMPLX_ARG (s), n, sdim, F77_CMPLX_ARG (pw), F77_CMPLX_ARG (q), n, rconde,
-                                 rcondv,
-                                 F77_CMPLX_ARG (pwork), lwork, prwork, pbwork, info
-                                 F77_CHAR_ARG_LEN (1)
-                                 F77_CHAR_ARG_LEN (1)
-                                 F77_CHAR_ARG_LEN (1)));
+      F77_XFCN (cgeesx, CGEESX,
+                (F77_CONST_CHAR_ARG2 (&jobvs, 1),
+                 F77_CONST_CHAR_ARG2 (&sort, 1),
+                 selector,
+                 F77_CONST_CHAR_ARG2 (&sense, 1),
+                 n, F77_CMPLX_ARG (s), n, sdim, F77_CMPLX_ARG (pw),
+                 F77_CMPLX_ARG (q), n,
+                 rconde, rcondv,
+                 F77_CMPLX_ARG (pwork), lwork, prwork, pbwork, info
+                 F77_CHAR_ARG_LEN (1)
+                 F77_CHAR_ARG_LEN (1)
+                 F77_CHAR_ARG_LEN (1)));
 
       return info;
     }
@@ -480,8 +489,9 @@
           OCTAVE_LOCAL_BUFFER (float, c, n-1);
           OCTAVE_LOCAL_BUFFER (float, sx, n-1);
 
-          F77_XFCN (crsf2csf, CRSF2CSF, (n, F77_CMPLX_ARG (s.fortran_vec ()),
-                                         F77_CMPLX_ARG (u.fortran_vec ()), c, sx));
+          F77_XFCN (crsf2csf, CRSF2CSF,
+                    (n, F77_CMPLX_ARG (s.fortran_vec ()),
+                     F77_CMPLX_ARG (u.fortran_vec ()), c, sx));
         }
 
       return schur<FloatComplexMatrix> (s, u);
--- a/liboctave/numeric/schur.h	Mon Aug 30 09:02:23 2021 -0700
+++ b/liboctave/numeric/schur.h	Mon Aug 30 09:45:47 2021 -0700
@@ -47,17 +47,17 @@
     {
     public:
 
-      schur (void) : m_schur_mat (), m_unitary_mat () { }
+      schur (void) : m_schur_mat (), m_unitary_schur_mat () { }
 
       schur (const T& a, const std::string& ord, bool calc_unitary = true)
-        : m_schur_mat (), m_unitary_mat ()
+        : m_schur_mat (), m_unitary_schur_mat ()
       {
         init (a, ord, calc_unitary);
       }
 
       schur (const T& a, const std::string& ord, octave_f77_int_type& info,
              bool calc_unitary = true)
-        : m_schur_mat (), m_unitary_mat ()
+        : m_schur_mat (), m_unitary_schur_mat ()
       {
         info = init (a, ord, calc_unitary);
       }
@@ -65,10 +65,12 @@
       // This one should really be protected or private but we need it in
       // rsf2csf and I don't see how to make that function a friend of
       // this class.
-      schur (const T& s, const T& u) : m_schur_mat (s), m_unitary_mat (u) { }
+      schur (const T& s, const T& u) : m_schur_mat (s), m_unitary_schur_mat (u)
+      { }
 
       schur (const schur& a)
-        : m_schur_mat (a.m_schur_mat), m_unitary_mat (a.m_unitary_mat)
+        : m_schur_mat (a.m_schur_mat),
+          m_unitary_schur_mat (a.m_unitary_schur_mat)
       { }
 
       schur& operator = (const schur& a)
@@ -76,7 +78,7 @@
         if (this != &a)
           {
             m_schur_mat = a.m_schur_mat;
-            m_unitary_mat = a.m_unitary_mat;
+            m_unitary_schur_mat = a.m_unitary_schur_mat;
           }
 
         return *this;
@@ -86,14 +88,14 @@
 
       T schur_matrix (void) const { return m_schur_mat; }
 
-      T unitary_matrix (void) const { return m_unitary_mat; }
+      T unitary_schur_matrix (void) const { return m_unitary_schur_mat; }
 
     protected:
 
     private:
 
       T m_schur_mat;
-      T m_unitary_mat;
+      T m_unitary_schur_mat;
 
       OCTAVE_API octave_f77_int_type
       init (const T& a, const std::string& ord, bool calc_unitary);