Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaldu committed Jan 6, 2024
1 parent 8a4bcc7 commit 307a1b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions test/serial/MatrixTest/MatrixMultiplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TEST_CASE("Test scalar product between two vector matrices") {

nnhep::Matrix<int> product{m1 * m2};

CHECK(product.get(0, 0) == 735);
CHECK(product(0, 0) == 735);
}

TEST_CASE("Test matrix product between two 2x2 matrices") {
Expand All @@ -37,10 +37,10 @@ TEST_CASE("Test matrix product between two 2x2 matrices") {
nnhep::Matrix<int> product(2, 2);
product = m1 * m2;

CHECK(product.get(0, 0) == 14);
CHECK(product.get(1, 0) == 30);
CHECK(product.get(0, 1) == 20);
CHECK(product.get(1, 1) == 44);
CHECK(product(0, 0) == 14);
CHECK(product(1, 0) == 30);
CHECK(product(0, 1) == 20);
CHECK(product(1, 1) == 44);
CHECK(product[0] == 14);
CHECK(product[1] == 20);
CHECK(product[2] == 30);
Expand Down
8 changes: 4 additions & 4 deletions test/serial/MatrixTest/MatrixSum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ TEST_CASE("Test matrix product between two 2x2 matrices") {
nnhep::Matrix<int> sum_matrix(2, 2);
sum_matrix = m1 + m2;

CHECK(sum_matrix.get(0, 0) == 3);
CHECK(sum_matrix.get(1, 0) == 9);
CHECK(sum_matrix.get(0, 1) == 6);
CHECK(sum_matrix.get(1, 1) == 12);
CHECK(sum_matrix(0, 0) == 3);
CHECK(sum_matrix(1, 0) == 9);
CHECK(sum_matrix(0, 1) == 6);
CHECK(sum_matrix(1, 1) == 12);
CHECK(sum_matrix[0] == 3);
CHECK(sum_matrix[1] == 6);
CHECK(sum_matrix[2] == 9);
Expand Down
4 changes: 2 additions & 2 deletions test/serial/MatrixTest/MatrixTransposition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ TEST_CASE("Test the transposition of a square matrix") {
CHECK(m2.ncols() == 4);
for (int i{}; i < m2.nrows(); ++i) {
for (int j{}; j < m2.ncols(); ++j) {
CHECK(m2.get(i, j) == m1.get(j, i));
CHECK(m2(i, j) == m1(j, i));
}
}
}
Expand All @@ -62,7 +62,7 @@ TEST_CASE("Test the transposition of a rectangular matrix") {
CHECK(m2.ncols() == 2);
for (int i{}; i < m2.nrows(); ++i) {
for (int j{}; j < m2.ncols(); ++j) {
CHECK(m2.get(i, j) == m1.get(j, i));
CHECK(m2(i, j) == m1(j, i));
}
}
}

0 comments on commit 307a1b0

Please sign in to comment.