Skip to content
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

checkMatrix return type refinement #4739

Open
ye-luo opened this issue Sep 19, 2023 · 2 comments
Open

checkMatrix return type refinement #4739

ye-luo opened this issue Sep 19, 2023 · 2 comments
Assignees

Comments

@ye-luo
Copy link
Contributor

ye-luo commented Sep 19, 2023

I saw repetitive line CHECKED_ELSE(check.result) { FAIL(check.result_message); } in https://github.com/QMCPACK/qmcpack/pull/4732/files

The code can be simplified by returning bool and throw error in checkMatrix instead of {bool, string}

@PDoakORNL
Copy link
Contributor

The string allows one to see per matrix element failures which I've used basically everytime I've needed this for debugging. Throws are slow so if you are just checking a matrix this is bad.

@ye-luo
Copy link
Contributor Author

ye-luo commented Nov 3, 2023

I'm not asking to throw immediately. Instead of return a string, you check the string and throw if it is not empty (indicating error). Throws are slow I don't think it is a concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants