From eb71d8cdd0eca733d719f5f21199e34f3b28e6e0 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 8 Nov 2014 00:53:30 +0000 Subject: [PATCH] Deprecate "copyData" method of array classes --- include/cantera/base/Array.h | 2 ++ include/cantera/numerics/BandMatrix.h | 1 + include/cantera/numerics/GeneralMatrix.h | 1 + include/cantera/numerics/SquareMatrix.h | 1 + src/numerics/BandMatrix.cpp | 1 + src/numerics/NonlinearSolver.cpp | 2 +- 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/cantera/base/Array.h b/include/cantera/base/Array.h index fcb9da3e6..f0431df6b 100644 --- a/include/cantera/base/Array.h +++ b/include/cantera/base/Array.h @@ -128,8 +128,10 @@ public: /*! * This differs from the assignment operator as no resizing is done and memcpy() is used. * @param y Array to be copied + * @deprecated To be removed after Cantera 2.2. */ void copyData(const Array2D& y) { + warn_deprecated("Array2D::copyData", "To be removed after Cantera 2.2."); size_t n = sizeof(doublereal) * m_nrows * m_ncols; (void) memcpy(DATA_PTR(m_data), y.ptrColumn(0), n); } diff --git a/include/cantera/numerics/BandMatrix.h b/include/cantera/numerics/BandMatrix.h index be470fc18..8564f52f1 100644 --- a/include/cantera/numerics/BandMatrix.h +++ b/include/cantera/numerics/BandMatrix.h @@ -273,6 +273,7 @@ public: /*! * This differs from the assignment operator as no resizing is done and memcpy() is used. * @param y Array to be copied + * @deprecated To be removed after Cantera 2.2. */ virtual void copyData(const GeneralMatrix& y); diff --git a/include/cantera/numerics/GeneralMatrix.h b/include/cantera/numerics/GeneralMatrix.h index b24221de8..071ccb679 100644 --- a/include/cantera/numerics/GeneralMatrix.h +++ b/include/cantera/numerics/GeneralMatrix.h @@ -178,6 +178,7 @@ public: /*! * This differs from the assignment operator as no resizing is done and memcpy() is used. * @param y Array to be copied + * @deprecated To be removed after Cantera 2.2. */ virtual void copyData(const GeneralMatrix& y) = 0; diff --git a/include/cantera/numerics/SquareMatrix.h b/include/cantera/numerics/SquareMatrix.h index b55e6c3c9..2b2d55980 100644 --- a/include/cantera/numerics/SquareMatrix.h +++ b/include/cantera/numerics/SquareMatrix.h @@ -89,6 +89,7 @@ public: return Array2D::operator()(i, j); } + //! @deprecated To be removed after Cantera 2.2. virtual void copyData(const GeneralMatrix& y); virtual doublereal operator()(size_t i, size_t j) const { diff --git a/src/numerics/BandMatrix.cpp b/src/numerics/BandMatrix.cpp index a09428d70..a8b3febfd 100644 --- a/src/numerics/BandMatrix.cpp +++ b/src/numerics/BandMatrix.cpp @@ -433,6 +433,7 @@ doublereal* const* BandMatrix::colPts() void BandMatrix::copyData(const GeneralMatrix& y) { + warn_deprecated("BandMatrix::copyData", "To be removed after Cantera 2.2."); m_factored = false; size_t n = sizeof(doublereal) * m_n * (2 *m_kl + m_ku + 1); GeneralMatrix* yyPtr = const_cast(&y); diff --git a/src/numerics/NonlinearSolver.cpp b/src/numerics/NonlinearSolver.cpp index 027106dcb..33f4f178f 100644 --- a/src/numerics/NonlinearSolver.cpp +++ b/src/numerics/NonlinearSolver.cpp @@ -3507,7 +3507,7 @@ int NonlinearSolver::beuler_jac(GeneralMatrix& J, doublereal* const f, * Make a copy of the data. Note, this jacobian copy occurs before any matrix scaling operations. * It's the raw matrix producted by this routine. */ - jacCopyPtr_->copyData(J); + *jacCopyPtr_ = J; return retn; }