Modernize BasisSet::print_detail_cfour #2937
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Much like PR #2804, this PR is mostly about eliminating
sprintf
-related compiler warnings and modernizing C-style string handling to C++, this time in libmints'BasisSet::print_detail_cfour
.Dev notes & details
BasisSet::print_detail_cfour()
, highlights:sprintf
and a fixed-size char arrayconst
wherever reasonablestd::find
on doubles is replaced by new functions (none_of_equal
andfpeq
) that implement a fuzzy compare with a default tolerance of 1E-14. Probably no behaviour change in practice (unless someone has basis fns which differ in exponent by >0 but <1E-14), but it is usually not recommended to use == on FP types, which is whatstd::find
does.slater.chemie.uni-mainz.de
URL has succumbed to link rot. Replaced with one that points to the latest version that is being preserved by the Internet Archive, both in the C++ and Python implementations.basisset.cc
andbasisset.h
Questions
none_of_equal
andfpeq
are just living inbasisset.cc
andbasisset.h
right now. Would some other file be a better place to put them?Checklist
std::find
change is behaviour-altering, albeit only in a corner case.Status