-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functionality tests utils dev #203
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkResult
seems simple and self-explanatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to checkResultNorms() to be more specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is now invoked in the main testing file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would invoke it before checkResult
. We want to establish first that SystemSolver
computes error norms correctly before we test its solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is now invoked in the main testing file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…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