Skip to content

Commit

Permalink
Included a description of the method
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovane Avancini authored and orlandini committed Aug 1, 2023
1 parent 8c90755 commit d28eb0a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Matrix/pzfmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ class TPZFMatrix: public TPZMatrix<TVar> {
static void MultAdd(const TVar *ptr, int64_t rows, int64_t cols, const TPZFMatrix<TVar> &x,const TPZFMatrix<TVar> &y, TPZFMatrix<TVar> &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<TVar> & A, bool transpA, const TPZFMatrix<TVar>& B,
bool transpB, const TVar alpha = 1.0) override;

Expand Down
2 changes: 1 addition & 1 deletion UnitTest_PZ/TestMatrix/TestMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d28eb0a

Please sign in to comment.