Mercurial > hg > octave-lojdl
changeset 15448:0a0912a9ab6e
Replace deprecated DiagArray2<T>::diag calls with DiagArray2<T>::extract_diag
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Thu, 27 Sep 2012 17:00:45 -0400 |
parents | 352349219529 |
children | 63dd6c30b294 |
files | libinterp/corefcn/__qp__.cc libinterp/corefcn/svd.cc libinterp/octave-value/ov-base-diag.cc 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 liboctave/array/CDiagMatrix.cc liboctave/array/CDiagMatrix.h liboctave/array/CMatrix.cc liboctave/array/dDiagMatrix.cc liboctave/array/dDiagMatrix.h liboctave/array/dMatrix.cc liboctave/array/fCDiagMatrix.cc liboctave/array/fCDiagMatrix.h liboctave/array/fCMatrix.cc liboctave/array/fDiagMatrix.cc liboctave/array/fDiagMatrix.h liboctave/array/fMatrix.cc |
diffstat | 19 files changed, 40 insertions(+), 40 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/__qp__.cc +++ b/libinterp/corefcn/__qp__.cc @@ -51,7 +51,7 @@ DiagMatrix S = A_svd.singular_values (); - ColumnVector s = S.diag (); + ColumnVector s = S.extract_diag (); Matrix V = A_svd.right_singular_matrix ();
--- a/libinterp/corefcn/svd.cc +++ b/libinterp/corefcn/svd.cc @@ -216,7 +216,7 @@ if (nargout == 0 || nargout == 1) { - retval(0) = sigma.diag (); + retval(0) = sigma.extract_diag (); } else { @@ -244,7 +244,7 @@ if (nargout == 0 || nargout == 1) { - retval(0) = sigma.diag (); + retval(0) = sigma.extract_diag (); } else { @@ -275,7 +275,7 @@ if (nargout == 0 || nargout == 1) { - retval(0) = sigma.diag (); + retval(0) = sigma.extract_diag (); } else { @@ -303,7 +303,7 @@ if (nargout == 0 || nargout == 1) { - retval(0) = sigma.diag (); + retval(0) = sigma.extract_diag (); } else {
--- a/libinterp/octave-value/ov-base-diag.cc +++ b/libinterp/octave-value/ov-base-diag.cc @@ -426,7 +426,7 @@ os << "# rows: " << matrix.rows () << "\n" << "# columns: " << matrix.columns () << "\n"; - os << matrix.diag (); + os << matrix.extract_diag (); return true; }
--- a/libinterp/octave-value/ov-cx-diag.cc +++ b/libinterp/octave-value/ov-cx-diag.cc @@ -149,7 +149,7 @@ return ::imag (matrix); case umap_sqrt: { - ComplexColumnVector tmp = matrix.diag ().map<Complex> (std::sqrt); + ComplexColumnVector tmp = matrix.extract_diag ().map<Complex> (std::sqrt); ComplexDiagMatrix retval (tmp); retval.resize (matrix.rows (), matrix.columns ()); return retval; @@ -167,7 +167,7 @@ os.write (reinterpret_cast<char *> (&r), 4); os.write (reinterpret_cast<char *> (&c), 4); - ComplexMatrix m = ComplexMatrix (matrix.diag ()); + ComplexMatrix m = ComplexMatrix (matrix.extract_diag ()); save_type st = LS_DOUBLE; if (save_as_floats) {
--- a/libinterp/octave-value/ov-flt-cx-diag.cc +++ b/libinterp/octave-value/ov-flt-cx-diag.cc @@ -133,7 +133,7 @@ return ::imag (matrix); case umap_sqrt: { - FloatComplexColumnVector tmp = matrix.diag ().map<FloatComplex> (std::sqrt); + FloatComplexColumnVector tmp = matrix.extract_diag ().map<FloatComplex> (std::sqrt); FloatComplexDiagMatrix retval (tmp); retval.resize (matrix.rows (), matrix.columns ()); return retval; @@ -153,7 +153,7 @@ os.write (reinterpret_cast<char *> (&r), 4); os.write (reinterpret_cast<char *> (&c), 4); - FloatComplexMatrix m = FloatComplexMatrix (matrix.diag ()); + FloatComplexMatrix m = FloatComplexMatrix (matrix.extract_diag ()); save_type st = LS_FLOAT; if (matrix.length () > 4096) // FIXME -- make this configurable. {
--- a/libinterp/octave-value/ov-flt-re-diag.cc +++ b/libinterp/octave-value/ov-flt-re-diag.cc @@ -103,7 +103,7 @@ return DiagMatrix (matrix.rows (), matrix.cols (), 0.0); case umap_sqrt: { - FloatComplexColumnVector tmp = matrix.diag ().map<FloatComplex> (rc_sqrt); + FloatComplexColumnVector tmp = matrix.extract_diag ().map<FloatComplex> (rc_sqrt); FloatComplexDiagMatrix retval (tmp); retval.resize (matrix.rows (), matrix.columns ()); return retval; @@ -122,7 +122,7 @@ os.write (reinterpret_cast<char *> (&r), 4); os.write (reinterpret_cast<char *> (&c), 4); - FloatMatrix m = FloatMatrix (matrix.diag ()); + FloatMatrix m = FloatMatrix (matrix.extract_diag ()); save_type st = LS_FLOAT; if (matrix.length () > 8192) // FIXME -- make this configurable. {
--- a/libinterp/octave-value/ov-re-diag.cc +++ b/libinterp/octave-value/ov-re-diag.cc @@ -163,7 +163,7 @@ return DiagMatrix (matrix.rows (), matrix.cols (), 0.0); case umap_sqrt: { - ComplexColumnVector tmp = matrix.diag ().map<Complex> (rc_sqrt); + ComplexColumnVector tmp = matrix.extract_diag ().map<Complex> (rc_sqrt); ComplexDiagMatrix retval (tmp); retval.resize (matrix.rows (), matrix.columns ()); return retval; @@ -181,7 +181,7 @@ os.write (reinterpret_cast<char *> (&r), 4); os.write (reinterpret_cast<char *> (&c), 4); - Matrix m = Matrix (matrix.diag ()); + Matrix m = Matrix (matrix.extract_diag ()); save_type st = LS_DOUBLE; if (save_as_floats) {
--- a/liboctave/array/CDiagMatrix.cc +++ b/liboctave/array/CDiagMatrix.cc @@ -236,13 +236,13 @@ DiagMatrix ComplexDiagMatrix::abs (void) const { - return DiagMatrix (diag ().abs (), rows (), columns ()); + return DiagMatrix (extract_diag ().abs (), rows (), columns ()); } ComplexDiagMatrix conj (const ComplexDiagMatrix& a) { - return ComplexDiagMatrix (conj (a.diag ()), a.rows (), a.columns ()); + return ComplexDiagMatrix (conj (a.extract_diag ()), a.rows (), a.columns ()); } // resize is the destructive analog for this one @@ -546,7 +546,7 @@ double ComplexDiagMatrix::rcond (void) const { - ColumnVector av = diag (0).map<double> (std::abs); + ColumnVector av = extract_diag (0).map<double> (std::abs); double amx = av.max (), amn = av.min (); return amx == 0 ? 0.0 : amn / amx; }
--- a/liboctave/array/CDiagMatrix.h +++ b/liboctave/array/CDiagMatrix.h @@ -120,8 +120,8 @@ // other operations - ComplexColumnVector diag (octave_idx_type k = 0) const - { return MDiagArray2<Complex>::diag (k); } + ComplexColumnVector extract_diag (octave_idx_type k = 0) const + { return MDiagArray2<Complex>::extract_diag (k); } ComplexDET determinant (void) const; double rcond (void) const;
--- a/liboctave/array/CMatrix.cc +++ b/liboctave/array/CMatrix.cc @@ -1183,7 +1183,7 @@ ComplexMatrix U = result.left_singular_matrix (); ComplexMatrix V = result.right_singular_matrix (); - ColumnVector sigma = S.diag (); + ColumnVector sigma = S.extract_diag (); octave_idx_type r = sigma.length () - 1; octave_idx_type nr = rows ();
--- a/liboctave/array/dDiagMatrix.cc +++ b/liboctave/array/dDiagMatrix.cc @@ -141,19 +141,19 @@ DiagMatrix DiagMatrix::abs (void) const { - return DiagMatrix (diag ().abs (), rows (), columns ()); + return DiagMatrix (extract_diag ().abs (), rows (), columns ()); } DiagMatrix real (const ComplexDiagMatrix& a) { - return DiagMatrix (real (a.diag ()), a.rows (), a.cols ()); + return DiagMatrix (real (a.extract_diag ()), a.rows (), a.cols ()); } DiagMatrix imag (const ComplexDiagMatrix& a) { - return DiagMatrix (imag (a.diag ()), a.rows (), a.cols ()); + return DiagMatrix (imag (a.extract_diag ()), a.rows (), a.cols ()); } Matrix @@ -362,7 +362,7 @@ double DiagMatrix::rcond (void) const { - ColumnVector av = diag (0).map<double> (fabs); + ColumnVector av = extract_diag (0).map<double> (fabs); double amx = av.max (), amn = av.min (); return amx == 0 ? 0.0 : amn / amx; }
--- a/liboctave/array/dDiagMatrix.h +++ b/liboctave/array/dDiagMatrix.h @@ -98,8 +98,8 @@ // other operations - ColumnVector diag (octave_idx_type k = 0) const - { return MDiagArray2<double>::diag (k); } + ColumnVector extract_diag (octave_idx_type k = 0) const + { return MDiagArray2<double>::extract_diag (k); } DET determinant (void) const; double rcond (void) const;
--- a/liboctave/array/dMatrix.cc +++ b/liboctave/array/dMatrix.cc @@ -856,7 +856,7 @@ Matrix U = result.left_singular_matrix (); Matrix V = result.right_singular_matrix (); - ColumnVector sigma = S.diag (); + ColumnVector sigma = S.extract_diag (); octave_idx_type r = sigma.length () - 1; octave_idx_type nr = rows ();
--- a/liboctave/array/fCDiagMatrix.cc +++ b/liboctave/array/fCDiagMatrix.cc @@ -236,13 +236,13 @@ FloatDiagMatrix FloatComplexDiagMatrix::abs (void) const { - return FloatDiagMatrix (diag ().abs (), rows (), columns ()); + return FloatDiagMatrix (extract_diag ().abs (), rows (), columns ()); } FloatComplexDiagMatrix conj (const FloatComplexDiagMatrix& a) { - return FloatComplexDiagMatrix (conj (a.diag ()), a.rows (), a.columns ()); + return FloatComplexDiagMatrix (conj (a.extract_diag ()), a.rows (), a.columns ()); } // resize is the destructive analog for this one @@ -546,7 +546,7 @@ float FloatComplexDiagMatrix::rcond (void) const { - FloatColumnVector av = diag (0).map<float> (std::abs); + FloatColumnVector av = extract_diag (0).map<float> (std::abs); float amx = av.max (), amn = av.min (); return amx == 0 ? 0.0f : amn / amx; }
--- a/liboctave/array/fCDiagMatrix.h +++ b/liboctave/array/fCDiagMatrix.h @@ -120,8 +120,8 @@ // other operations - FloatComplexColumnVector diag (octave_idx_type k = 0) const - { return MDiagArray2<FloatComplex>::diag (k); } + FloatComplexColumnVector extract_diag (octave_idx_type k = 0) const + { return MDiagArray2<FloatComplex>::extract_diag (k); } FloatComplexDET determinant (void) const; float rcond (void) const;
--- a/liboctave/array/fCMatrix.cc +++ b/liboctave/array/fCMatrix.cc @@ -1185,7 +1185,7 @@ FloatComplexMatrix U = result.left_singular_matrix (); FloatComplexMatrix V = result.right_singular_matrix (); - FloatColumnVector sigma = S.diag (); + FloatColumnVector sigma = S.extract_diag (); octave_idx_type r = sigma.length () - 1; octave_idx_type nr = rows ();
--- a/liboctave/array/fDiagMatrix.cc +++ b/liboctave/array/fDiagMatrix.cc @@ -141,19 +141,19 @@ FloatDiagMatrix FloatDiagMatrix::abs (void) const { - return FloatDiagMatrix (diag ().abs (), rows (), columns ()); + return FloatDiagMatrix (extract_diag ().abs (), rows (), columns ()); } FloatDiagMatrix real (const FloatComplexDiagMatrix& a) { - return FloatDiagMatrix (real (a.diag ()), a.rows (), a.columns ()); + return FloatDiagMatrix (real (a.extract_diag ()), a.rows (), a.columns ()); } FloatDiagMatrix imag (const FloatComplexDiagMatrix& a) { - return FloatDiagMatrix (imag (a.diag ()), a.rows (), a.columns ()); + return FloatDiagMatrix (imag (a.extract_diag ()), a.rows (), a.columns ()); } FloatMatrix @@ -362,7 +362,7 @@ float FloatDiagMatrix::rcond (void) const { - FloatColumnVector av = diag (0).map<float> (fabsf); + FloatColumnVector av = extract_diag (0).map<float> (fabsf); float amx = av.max (), amn = av.min (); return amx == 0 ? 0.0f : amn / amx; }
--- a/liboctave/array/fDiagMatrix.h +++ b/liboctave/array/fDiagMatrix.h @@ -98,8 +98,8 @@ // other operations - FloatColumnVector diag (octave_idx_type k = 0) const - { return MDiagArray2<float>::diag (k); } + FloatColumnVector extract_diag (octave_idx_type k = 0) const + { return MDiagArray2<float>::extract_diag (k); } FloatDET determinant (void) const; float rcond (void) const;
--- a/liboctave/array/fMatrix.cc +++ b/liboctave/array/fMatrix.cc @@ -856,7 +856,7 @@ FloatMatrix U = result.left_singular_matrix (); FloatMatrix V = result.right_singular_matrix (); - FloatColumnVector sigma = S.diag (); + FloatColumnVector sigma = S.extract_diag (); octave_idx_type r = sigma.length () - 1; octave_idx_type nr = rows ();