Fix container type and empty-vector defects in the composite quadratures - #105
Open
susilehtola wants to merge 1 commit into
Open
Fix container type and empty-vector defects in the composite quadratures#105susilehtola wants to merge 1 commit into
susilehtola wants to merge 1 commit into
Conversation
Three unrelated defects in the same two headers.
SubQuadrature's generator declared its weights in the *point* container
type and returned it as the weight_container half of the tuple:
point_container points ( ... );
point_container weights( ... ); // wrong type
This compiles today only because every radial quadrature happens to use
std::vector<double> for both. It breaks as soon as the two differ, which
is exactly what mixed precision needs: SubQuadrature<Becke<float,double>>
does not compile before this change. Two of the surrounding assertions
also tested `>= 0` on size_t, which is vacuous; drop them and keep the
bounds that say something.
RadialGridPartition::finalize() read partition_idx_.back() without
checking that anything had been added, which is undefined behaviour on an
empty vector. make_pruned_grid() guards against an empty region list one
layer up, but finalize() is public and the class is default-constructible,
so the guard is not structural. Throw instead.
Six adaptor overrides in the two spherical quadrature headers were
written as `override {;` -- a stray empty statement after the opening
brace. Harmless, but remove them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FDTFYJMQ76iujDFNHzZyXF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Three unrelated defects in the same two headers.
SubQuadrature's generator declared its weights in the point container
type and returned it as the weight_container half of the tuple:
This compiles today only because every radial quadrature happens to use
std::vector for both. It breaks as soon as the two differ, which
is exactly what mixed precision needs: SubQuadrature<Becke<float,double>>
does not compile before this change. Two of the surrounding assertions
also tested
>= 0on size_t, which is vacuous; drop them and keep thebounds that say something.
RadialGridPartition::finalize() read partition_idx_.back() without
checking that anything had been added, which is undefined behaviour on an
empty vector. make_pruned_grid() guards against an empty region list one
layer up, but finalize() is public and the class is default-constructible,
so the guard is not structural. Throw instead.
Six adaptor overrides in the two spherical quadrature headers were
written as
override {;-- a stray empty statement after the openingbrace. Harmless, but remove them.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01FDTFYJMQ76iujDFNHzZyXF