changeset 23594:af5b813503cb

maint: Deprecate is_hermitian and replace with ishermitian. * CMatrix.h (is_hermitian): Use OCTAVE_DEPRECATED macro around function. * CMatrix.h (ishermitian): New function. * CSparse.h (is_hermitian): Use OCTAVE_DEPRECATED macro around function. * CSparse.h (ishermitian): New function. * MatrixType.h (is_hermitian): Use OCTAVE_DEPRECATED macro around function. * MatrixType.h (ishermitian): New function. * fCMatrix.h (is_hermitian): Use OCTAVE_DEPRECATED macro around function. * fCMatrix.h (ishermitian): New function. * CMatrix.cc, CSparse.cc, dMatrix.cc, dSparse.cc, fCMatrix.cc, fMatrix.cc, EIG.cc, fEIG.cc: Replace instances of is_hermitian with ishermitian.
author Rik <rik@octave.org>
date Wed, 14 Jun 2017 08:14:08 -0700
parents a8361bc2361a
children d70434783da3
files liboctave/array/CMatrix.cc liboctave/array/CMatrix.h liboctave/array/CSparse.cc liboctave/array/CSparse.h liboctave/array/MatrixType.h liboctave/array/dMatrix.cc liboctave/array/dSparse.cc liboctave/array/fCMatrix.cc liboctave/array/fCMatrix.h liboctave/array/fMatrix.cc liboctave/numeric/EIG.cc liboctave/numeric/fEIG.cc
diffstat 12 files changed, 43 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/array/CMatrix.cc	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/array/CMatrix.cc	Wed Jun 14 08:14:08 2017 -0700
@@ -170,7 +170,7 @@
 }
 
 bool
-ComplexMatrix::is_hermitian (void) const
+ComplexMatrix::ishermitian (void) const
 {
   octave_idx_type nr = rows ();
   octave_idx_type nc = cols ();
@@ -917,7 +917,7 @@
     ret = tinverse (mattype, info, rcon, force, calc_cond);
   else
     {
-      if (mattype.is_hermitian ())
+      if (mattype.ishermitian ())
         {
           octave::math::chol<ComplexMatrix> chol (*this, info, true, calc_cond);
           if (info == 0)
@@ -932,10 +932,10 @@
             mattype.mark_as_unsymmetric ();
         }
 
-      if (! mattype.is_hermitian ())
+      if (! mattype.ishermitian ())
         ret = finverse (mattype, info, rcon, force, calc_cond);
 
-      if ((calc_cond || mattype.is_hermitian ()) && rcon == 0.)
+      if ((calc_cond || mattype.ishermitian ()) && rcon == 0.)
         {
           if (numel () == 1)
             ret = ComplexMatrix (1, 1, 0.);
--- a/liboctave/array/CMatrix.h	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/array/CMatrix.h	Wed Jun 14 08:14:08 2017 -0700
@@ -109,7 +109,11 @@
   bool operator == (const ComplexMatrix& a) const;
   bool operator != (const ComplexMatrix& a) const;
 
-  bool is_hermitian (void) const;
+  bool ishermitian (void) const;
+
+  OCTAVE_DEPRECATED ("use 'is_hermitian' instead")
+  bool is_hermitian (void) const
+  { return ishermitian (); }
 
   // destructive insert/delete/reorder operations
 
--- a/liboctave/array/CSparse.cc	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/array/CSparse.cc	Wed Jun 14 08:14:08 2017 -0700
@@ -138,7 +138,7 @@
 }
 
 bool
-SparseComplexMatrix::is_hermitian (void) const
+SparseComplexMatrix::ishermitian (void) const
 {
   octave_idx_type nr = rows ();
   octave_idx_type nc = cols ();
@@ -1001,7 +1001,7 @@
     }
   else
     {
-      if (mattype.is_hermitian ())
+      if (mattype.ishermitian ())
         {
           MatrixType tmp_typ (MatrixType::Upper);
           octave::math::sparse_chol<SparseComplexMatrix> fact (*this, info, false);
@@ -1022,7 +1022,7 @@
             }
         }
 
-      if (! mattype.is_hermitian ())
+      if (! mattype.ishermitian ())
         {
           octave_idx_type n = rows ();
           ColumnVector Qinit(n);
--- a/liboctave/array/CSparse.h	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/array/CSparse.h	Wed Jun 14 08:14:08 2017 -0700
@@ -111,7 +111,11 @@
   bool operator == (const SparseComplexMatrix& a) const;
   bool operator != (const SparseComplexMatrix& a) const;
 
-  bool is_hermitian (void) const;
+  bool ishermitian (void) const;
+
+  OCTAVE_DEPRECATED ("use 'is_hermitian' instead")
+  bool is_hermitian (void) const
+  { return ishermitian (); }
 
   SparseComplexMatrix max (int dim = -1) const;
   SparseComplexMatrix max (Array<octave_idx_type>& index, int dim = -1) const;
--- a/liboctave/array/MatrixType.h	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/array/MatrixType.h	Wed Jun 14 08:14:08 2017 -0700
@@ -122,12 +122,16 @@
   bool is_tridiagonal (void) const
   { return (typ == Tridiagonal || typ == Tridiagonal_Hermitian); }
 
-  bool is_hermitian (void) const
+  bool ishermitian (void) const
   {
     return (typ == Banded_Hermitian || typ == Tridiagonal_Hermitian
             || typ == Hermitian);
   }
 
+  OCTAVE_DEPRECATED ("use 'is_hermitian' instead")
+  bool is_hermitian (void) const
+  { return ishermitian (); }
+
   bool is_rectangular (void) const { return (typ == Rectangular); }
 
   bool is_known (void) const { return (typ != Unknown); }
--- a/liboctave/array/dMatrix.cc	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/array/dMatrix.cc	Wed Jun 14 08:14:08 2017 -0700
@@ -621,7 +621,7 @@
     ret = tinverse (mattype, info, rcon, force, calc_cond);
   else
     {
-      if (mattype.is_hermitian ())
+      if (mattype.ishermitian ())
         {
           octave::math::chol<Matrix> chol (*this, info, true, calc_cond);
           if (info == 0)
@@ -636,10 +636,10 @@
             mattype.mark_as_unsymmetric ();
         }
 
-      if (! mattype.is_hermitian ())
+      if (! mattype.ishermitian ())
         ret = finverse (mattype, info, rcon, force, calc_cond);
 
-      if ((calc_cond || mattype.is_hermitian ()) && rcon == 0.
+      if ((calc_cond || mattype.ishermitian ()) && rcon == 0.
           && ! (numel () == 1))
         ret = Matrix (rows (), columns (),
                       octave::numeric_limits<double>::Inf ());
--- a/liboctave/array/dSparse.cc	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/array/dSparse.cc	Wed Jun 14 08:14:08 2017 -0700
@@ -1079,7 +1079,7 @@
     }
   else
     {
-      if (mattype.is_hermitian ())
+      if (mattype.ishermitian ())
         {
           MatrixType tmp_typ (MatrixType::Upper);
           octave::math::sparse_chol<SparseMatrix> fact (*this, info, false);
@@ -1099,7 +1099,7 @@
             }
         }
 
-      if (! mattype.is_hermitian ())
+      if (! mattype.ishermitian ())
         {
           octave_idx_type n = rows ();
           ColumnVector Qinit(n);
--- a/liboctave/array/fCMatrix.cc	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/array/fCMatrix.cc	Wed Jun 14 08:14:08 2017 -0700
@@ -170,7 +170,7 @@
 }
 
 bool
-FloatComplexMatrix::is_hermitian (void) const
+FloatComplexMatrix::ishermitian (void) const
 {
   octave_idx_type nr = rows ();
   octave_idx_type nc = cols ();
@@ -919,7 +919,7 @@
     ret = tinverse (mattype, info, rcon, force, calc_cond);
   else
     {
-      if (mattype.is_hermitian ())
+      if (mattype.ishermitian ())
         {
           octave::math::chol<FloatComplexMatrix> chol (*this, info, true, calc_cond);
           if (info == 0)
@@ -934,10 +934,10 @@
             mattype.mark_as_unsymmetric ();
         }
 
-      if (! mattype.is_hermitian ())
+      if (! mattype.ishermitian ())
         ret = finverse (mattype, info, rcon, force, calc_cond);
 
-      if ((calc_cond || mattype.is_hermitian ()) && rcon == 0.)
+      if ((calc_cond || mattype.ishermitian ()) && rcon == 0.)
         {
           if (numel () == 1)
             ret = FloatComplexMatrix (1, 1, 0.);
--- a/liboctave/array/fCMatrix.h	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/array/fCMatrix.h	Wed Jun 14 08:14:08 2017 -0700
@@ -114,7 +114,11 @@
   bool operator == (const FloatComplexMatrix& a) const;
   bool operator != (const FloatComplexMatrix& a) const;
 
-  bool is_hermitian (void) const;
+  bool ishermitian (void) const;
+
+  OCTAVE_DEPRECATED ("use 'is_hermitian' instead")
+  bool is_hermitian (void) const
+  { return ishermitian (); }
 
   // destructive insert/delete/reorder operations
 
--- a/liboctave/array/fMatrix.cc	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/array/fMatrix.cc	Wed Jun 14 08:14:08 2017 -0700
@@ -628,7 +628,7 @@
     ret = tinverse (mattype, info, rcon, force, calc_cond);
   else
     {
-      if (mattype.is_hermitian ())
+      if (mattype.ishermitian ())
         {
           octave::math::chol<FloatMatrix> chol (*this, info, true, calc_cond);
           if (info == 0)
@@ -643,10 +643,10 @@
             mattype.mark_as_unsymmetric ();
         }
 
-      if (! mattype.is_hermitian ())
+      if (! mattype.ishermitian ())
         ret = finverse (mattype, info, rcon, force, calc_cond);
 
-      if ((calc_cond || mattype.is_hermitian ()) && rcon == 0.
+      if ((calc_cond || mattype.ishermitian ()) && rcon == 0.
           && ! (numel () == 1))
         ret = FloatMatrix (rows (), columns (),
                            octave::numeric_limits<float>::Inf ());
--- a/liboctave/numeric/EIG.cc	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/numeric/EIG.cc	Wed Jun 14 08:14:08 2017 -0700
@@ -231,7 +231,7 @@
     (*current_liboctave_error_handler)
       ("EIG: matrix contains Inf or NaN values");
 
-  if (a.is_hermitian ())
+  if (a.ishermitian ())
     return hermitian_init (a, calc_rev, calc_lev);
 
   F77_INT n = octave::to_f77_int (a.rows ());
@@ -624,7 +624,7 @@
                                  info
                                  F77_CHAR_ARG_LEN (1)));
 
-      if (a.is_hermitian () && b.is_hermitian () && info == 0)
+      if (a.ishermitian () && b.ishermitian () && info == 0)
         return hermitian_init (a, b, calc_rev, calc_lev);
     }
 
--- a/liboctave/numeric/fEIG.cc	Tue Jun 13 22:05:03 2017 -0700
+++ b/liboctave/numeric/fEIG.cc	Wed Jun 14 08:14:08 2017 -0700
@@ -230,7 +230,7 @@
     (*current_liboctave_error_handler)
       ("EIG: matrix contains Inf or NaN values");
 
-  if (a.is_hermitian ())
+  if (a.ishermitian ())
     return hermitian_init (a, calc_rev, calc_lev);
 
   F77_INT n = octave::to_f77_int (a.rows ());
@@ -619,7 +619,7 @@
                                  info
                                  F77_CHAR_ARG_LEN (1)));
 
-      if (a.is_hermitian () && b.is_hermitian () && info == 0)
+      if (a.ishermitian () && b.ishermitian () && info == 0)
         return hermitian_init (a, b, calc_rev, calc_lev);
     }