Functionality tests utils dev#203
Conversation
superwhiskers
left a comment
There was a problem hiding this comment.
some minor things that stuck out to me that may be worth considering
| namespace ReSolve { | ||
| namespace tests{ | ||
|
|
||
| int FunctionalityTestHelper::checkRefactorizationResult(ReSolve::matrix::Csr& A, |
There was a problem hiding this comment.
the name checkRefactorizationResult doesn't seem to be too appropriate here. while the only current exception is lusol, it may be more appropriate to name this checkResult, checkFactors, or something along those lines if this is to be more general in the future
There was a problem hiding this comment.
checkResult seems simple and self-explanatory.
There was a problem hiding this comment.
I changed this to checkResultNorms() to be more specific
There was a problem hiding this comment.
Checking error norms is how one would check the result, so checkResult will be as informative and less redundant, imho.
There was a problem hiding this comment.
changed to checkResult
6e485dc to
a933508
Compare
| // Verify relative residual norm computation in SystemSolver | ||
| error_sum += checkRelativeResidualNorm(vec_rhs, vec_x, residual_norm_, rhs_norm_, solver); |
There was a problem hiding this comment.
Can we make this call in testSysRefactor.cpp rather than here? Perhaps there will be an instance where we want to just check the result and not norm computation.
There was a problem hiding this comment.
this function is now invoked in the main testing file
There was a problem hiding this comment.
I would invoke it before checkResult. We want to establish first that SystemSolver computes error norms correctly before we test its solution.
| // Compute norm of scaled residuals: | ||
| // NSR = ||r||_inf / (||A||_inf * ||x||_inf) | ||
| error_sum += checkNormOfScaledResiduals(A, vec_rhs, vec_x, vec_r, solver); | ||
|
|
There was a problem hiding this comment.
The call to checkNormOfScaledResiduals should probably be made from testSysRefactor.cpp instead of here. I would make this function check the result only.
There was a problem hiding this comment.
this function is now invoked in the main testing file
…ty for 2nd matrix
|
note: the following improvements extend the work so far, but should probably be in a separate PR:
|
Linked issue: #193
note: this PR has been opened and closed a few times due to insufficient testing before pushing. The others did not pass the checks. This PR applies a testing helper class to remove boilerplate from a single testing file