From f260e858c0fe697098db7d5714656073757a35df Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 11 Apr 2016 15:39:22 -0400 Subject: [PATCH] [Numerics] Deprecate class SquareMatrix --- include/cantera/numerics.h | 1 - include/cantera/numerics/ResidJacEval.h | 8 ++++---- include/cantera/numerics/SquareMatrix.h | 1 + src/numerics/ResidJacEval.cpp | 2 +- src/numerics/SquareMatrix.cpp | 4 ++++ 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/cantera/numerics.h b/include/cantera/numerics.h index 392f155f0..115c87581 100644 --- a/include/cantera/numerics.h +++ b/include/cantera/numerics.h @@ -10,6 +10,5 @@ #include "numerics/DenseMatrix.h" #include "numerics/BandMatrix.h" -#include "numerics/SquareMatrix.h" #endif diff --git a/include/cantera/numerics/ResidJacEval.h b/include/cantera/numerics/ResidJacEval.h index e78a4cb7a..0c548dd07 100644 --- a/include/cantera/numerics/ResidJacEval.h +++ b/include/cantera/numerics/ResidJacEval.h @@ -15,7 +15,7 @@ #define CT_RESIDJACEVAL_H #include "ResidEval.h" -#include "GeneralMatrix.h" +#include "DenseMatrix.h" namespace Cantera { @@ -271,7 +271,7 @@ public: * @param cj Coefficient of yprime used in the evaluation of the Jacobian * @param y Solution vector (input, do not modify) * @param ydot Rate of change of solution vector. (input, do not modify) - * @param J Reference to the SquareMatrix object to be calculated (output) + * @param J Reference to the DenseMatrix object to be calculated (output) * @param resid Value of the residual that is computed (output) * @returns a flag to indicate that operation is successful. * 1 Means a successful operation @@ -279,7 +279,7 @@ public: */ virtual int evalJacobian(const doublereal t, const doublereal delta_t, doublereal cj, const doublereal* const y, const doublereal* const ydot, - GeneralMatrix& J, doublereal* const resid); + DenseMatrix& J, doublereal* const resid); //! Calculate an analytical Jacobian and the residual at the current time and values. /*! @@ -290,7 +290,7 @@ public: * @param cj Coefficient of yprime used in the evaluation of the Jacobian * @param y Solution vector (input, do not modify) * @param ydot Rate of change of solution vector. (input, do not modify) - * @param jacobianColPts Pointer to the vector of pts to columns of the SquareMatrix + * @param jacobianColPts Pointer to the vector of pts to columns of the DenseMatrix * object to be calculated (output) * @param resid Value of the residual that is computed (output) * @returns a flag to indicate that operation is successful. diff --git a/include/cantera/numerics/SquareMatrix.h b/include/cantera/numerics/SquareMatrix.h index 18b0e4c90..1447cb070 100644 --- a/include/cantera/numerics/SquareMatrix.h +++ b/include/cantera/numerics/SquareMatrix.h @@ -19,6 +19,7 @@ namespace Cantera /** * A class for full (non-sparse) matrices with Fortran-compatible data storage. * Adds matrix inversion operations to this class from DenseMatrix. + * @deprecated Use class DenseMatrix instead. To be removed after Cantera 2.3. */ class SquareMatrix: public DenseMatrix, public GeneralMatrix { diff --git a/src/numerics/ResidJacEval.cpp b/src/numerics/ResidJacEval.cpp index 5a5ce2ea9..a9ad2c8c3 100644 --- a/src/numerics/ResidJacEval.cpp +++ b/src/numerics/ResidJacEval.cpp @@ -164,7 +164,7 @@ int ResidJacEval::eval(const doublereal t, const doublereal* const y, const doub int ResidJacEval::evalJacobian(const doublereal t, const doublereal delta_t, doublereal cj, const doublereal* const y, - const doublereal* const ydot, GeneralMatrix& J, + const doublereal* const ydot, DenseMatrix& J, doublereal* const resid) { doublereal* const* jac_colPts = J.colPts(); diff --git a/src/numerics/SquareMatrix.cpp b/src/numerics/SquareMatrix.cpp index 05669ab5c..9e595d0a7 100644 --- a/src/numerics/SquareMatrix.cpp +++ b/src/numerics/SquareMatrix.cpp @@ -21,6 +21,8 @@ SquareMatrix::SquareMatrix() : a1norm_(0.0), useQR_(0) { + warn_deprecated("class SquareMatrix", + "Use class DenseMatrix instead. To be removed after Cantera 2.3."); } SquareMatrix::SquareMatrix(size_t n, doublereal v) : @@ -29,6 +31,8 @@ SquareMatrix::SquareMatrix(size_t n, doublereal v) : a1norm_(0.0), useQR_(0) { + warn_deprecated("class SquareMatrix", + "Use class DenseMatrix instead. To be removed after Cantera 2.3."); } SquareMatrix::SquareMatrix(const SquareMatrix& y) :