Skip to content

Commit ab5926d

Browse files
author
rcrutherford
committed
Removed unecessary casting in matrix test matrixTransAddToSymDenseMatrixUpperTriangle
1 parent f46884c commit ab5926d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/LinAlg/matrixTests.hpp

+8-10
Original file line numberDiff line numberDiff line change
@@ -564,18 +564,16 @@ class MatrixTests : public TestBase
564564
* Precondition: W is square
565565
*/
566566
int matrixTransAddToSymDenseMatrixUpperTriangle(
567-
hiop::hiopMatrixDense& _W,
567+
hiop::hiopMatrixDense& W,
568568
hiop::hiopMatrixDense& A,
569569
const int rank=0)
570570
{
571-
// This method only takes hiopMatrixDense
572-
auto W = dynamic_cast<hiop::hiopMatrixDense*>(&_W);
573-
const local_ordinal_type N_loc = getNumLocCols(W);
571+
const local_ordinal_type N_loc = getNumLocCols(&W);
574572
const local_ordinal_type A_M = getNumLocRows(&A);
575573
const local_ordinal_type A_N_loc = getNumLocCols(&A);
576-
assert(W->m() == W->n());
577-
assert(getNumLocRows(W) >= getNumLocRows(&A));
578-
assert(W->n() >= A.n());
574+
assert(W.m() == W.n());
575+
assert(getNumLocRows(&W) >= getNumLocRows(&A));
576+
assert(W.n() >= A.n());
579577

580578
const local_ordinal_type start_idx_row = 0;
581579
const local_ordinal_type start_idx_col = N_loc - A_M;
@@ -584,9 +582,9 @@ class MatrixTests : public TestBase
584582
W_val = one;
585583

586584
A.setToConstant(A_val);
587-
W->setToConstant(W_val);
588-
A.transAddToSymDenseMatrixUpperTriangle(start_idx_row, start_idx_col, alpha, *W);
589-
const int fail = verifyAnswer(W,
585+
W.setToConstant(W_val);
586+
A.transAddToSymDenseMatrixUpperTriangle(start_idx_row, start_idx_col, alpha, W);
587+
const int fail = verifyAnswer(&W,
590588
[=] (local_ordinal_type i, local_ordinal_type j) -> real_type
591589
{
592590
const bool isTransUpperTriangle = (

0 commit comments

Comments
 (0)