From d28eb0a8df1cba0887da53bdcd7e7884f8c886c6 Mon Sep 17 00:00:00 2001 From: Giovane Avancini Date: Tue, 1 Aug 2023 11:58:13 -0300 Subject: [PATCH] Included a description of the method --- Matrix/pzfmatrix.h | 10 ++++++++++ UnitTest_PZ/TestMatrix/TestMatrix.cpp | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Matrix/pzfmatrix.h b/Matrix/pzfmatrix.h index 188b375c2..8e23a80ca 100644 --- a/Matrix/pzfmatrix.h +++ b/Matrix/pzfmatrix.h @@ -217,6 +217,16 @@ class TPZFMatrix: public TPZMatrix { static void MultAdd(const TVar *ptr, int64_t rows, int64_t cols, const TPZFMatrix &x,const TPZFMatrix &y, TPZFMatrix &z, const TVar alpha=1.,const TVar beta = 0.,const int opt = 0); + /** + * @brief It computes this += alpha*(A * B), where A or B can be transposed. + * @param i Is the row of (this) where the first element of the matrices product should be added + * @param j Is the column of (this) where the first element of the matrices product should be added + * @param A Is A on the above operation + * @param transpA Indicates if A is Transpose or not + * @param B Is B on the above operation + * @param transpB Indicates if B is Transpose or not + * @param alpha Is alpha on the above operation + */ virtual void AddContribution(int64_t i, int64_t j, const TPZFMatrix & A, bool transpA, const TPZFMatrix& B, bool transpB, const TVar alpha = 1.0) override; diff --git a/UnitTest_PZ/TestMatrix/TestMatrix.cpp b/UnitTest_PZ/TestMatrix/TestMatrix.cpp index 778e14d0c..7c3804e10 100644 --- a/UnitTest_PZ/TestMatrix/TestMatrix.cpp +++ b/UnitTest_PZ/TestMatrix/TestMatrix.cpp @@ -1815,7 +1815,7 @@ void TestingAddContribution(int nrows, int ncols, int ntype) } case 1: // Multiplying matrices with incompatible dimensions { - REQUIRE_THROWS(C1.AddContribution(0, 0, A, false, B, false, 1.0)); // this will fail because we are multiplying A*B that have the same dimensions + REQUIRE_THROWS(C1.AddContribution(0, 0, A, false, B, false, 1.0)); // this will fail for not square matrices, as A and B have the same sizes break; } case 2: // Adding a contribution out of matrix bounds