hiop
hiop copied to clipboard
Sparse Matrix Tests Refactoring
In this PR:
- Deleted any commented out/unused methods that I noticed in the sparse matrix tests. Includes tests moved to sym sparse matrix tests
- Moved some methods to implementation-specific tests where appropriate
- Refactored sparse test matrix test driver
- Cleaned up exception handling in implementation-specific tests (including in vectorTests that were missed in #170)
Once #103 is resolved, this implementation-specific section in testMatrixSparse.cpp should probably be removed, along with a RAJA specific test implemented. A new issue can be created to track this if need be, or implementing this test can be part of closing out #103:
//
// Perform hipoMatrixSparseTriplet specific tests
//
//auto * test_triplet = dynamic_cast<tests::MatrixTestsSparseTriplet *>(&test);
if (dynamic_cast<tests::MatrixTestsSparseTriplet *>(&test))
{
fail += test.copyRowsBlockFrom(*mxn_sparse, *m2xn_sparse,0, 1, M_global-1, mxn_sparse->numberOfNonzeros()-entries_per_row);
}
I will note that this dynamic cast in the template function will always throw a warning: warning: dynamic_cast of ‘hiop::tests::MatrixTestsRajaSparseTriplet test’ to ‘class hiop::tests::MatrixTestsSparseTriplet*’ can never succeed
. It seems like an appropriate solution for the moment.
@CameronRutherford Thanks! This looks much better and clearer.
@pelesh : is this PR still under development or it only waits for you review?
@pelesh : is this PR still under development or it only waits for you review?
Not quite ready to be merged yet.