# HG changeset patch # User Rik # Date 1630341947 25200 # Node ID 1e277c6b6626f426ce47a49030d142bd8f4f0a13 # Parent 96a40641d86e182680ccdd328b11064651924490 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". diff -r 96a40641d86e -r 1e277c6b6626 libinterp/corefcn/schur.cc --- 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 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 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 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 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 cs = math::rsf2csf (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 cs = math::rsf2csf (t, u); - return ovl (cs.unitary_matrix (), cs.schur_matrix ()); + return ovl (cs.unitary_schur_matrix (), cs.schur_matrix ()); } } diff -r 96a40641d86e -r 1e277c6b6626 libinterp/corefcn/sqrtm.cc --- 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. diff -r 96a40641d86e -r 1e277c6b6626 liboctave/array/CMatrix.cc --- 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; diff -r 96a40641d86e -r 1e277c6b6626 liboctave/array/dMatrix.cc --- 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; diff -r 96a40641d86e -r 1e277c6b6626 liboctave/array/fCMatrix.cc --- 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; diff -r 96a40641d86e -r 1e277c6b6626 liboctave/array/fMatrix.cc --- 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; diff -r 96a40641d86e -r 1e277c6b6626 liboctave/numeric/schur.cc --- 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::init (const Matrix& a, const std::string& ord, bool calc_unitary) + schur::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 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 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 rwork (dim_vector (n, 1)); double *prwork = rwork.fortran_vec (); @@ -339,16 +343,17 @@ Array 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 (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 rwork (dim_vector (n, 1)); float *prwork = rwork.fortran_vec (); @@ -447,16 +454,18 @@ Array 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 (s, u); diff -r 96a40641d86e -r 1e277c6b6626 liboctave/numeric/schur.h --- 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);