Skip to content

Commit

Permalink
Fix unit tests to use multiply_vector()
Browse files Browse the repository at this point in the history
  • Loading branch information
cm-jones committed Jun 29, 2024
1 parent 136f4dc commit a358567
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,15 +496,14 @@ TEST_F(MatrixTest, Solve) {
Matrix<double> mat(3, 3, {3, 2, -1, 2, -2, 4, -1, 0.5, -1});
Vector<double> vec({1, -2, 0});
Vector<double> solution = mat.solve(vec);

// Check Ax = b
Vector<double> result = mat * solution;
Vector<double> result = mat.multiply_vector(solution);
EXPECT_NEAR(result[0], vec[0], 1e-9);
EXPECT_NEAR(result[1], vec[1], 1e-9);
EXPECT_NEAR(result[2], vec[2], 1e-9);
}

// Main function to run the tests
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
Expand Down

0 comments on commit a358567

Please sign in to comment.