Fix: correct column index assertion in Matrix_Corner_Block and Matrix_Periodic_Banded #566#567
Merged
EmilyBourne merged 2 commits intoMar 4, 2026
Conversation
EmilyBourne
approved these changes
Mar 4, 2026
Member
|
@Quntized Thanks again for this bug fix. Well done for catching all these corner cases! |
Contributor
Author
Thank you, I'm really enjoying the project. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
EmilyBourne
pushed a commit
that referenced
this pull request
Mar 5, 2026
…_Periodic_Banded #566 (#567) Fix: correct column index assertion in Matrix_Corner_Block and Matrix_Periodic_Banded #566 In ```src/matrix_tools/matrix_corner_block.cpp``` and ``` src/matrix_tools/matrix_periodic_banded.cpp``` both get_element and set_element contain same assert twice assert(i < n); and not the check for j any. This maybe copy-paste typo accidentally. ``` double Matrix_Corner_Block::get_element(int const i, int const j) const { assert(i >= 0); assert(i < n); assert(j >= 0); assert(i < n); //This should be checked for j; .... } ``` and ``` void Matrix_Corner_Block::set_element(int const i, int const j, double const a_ij) { assert(i >= 0); assert(i < n); assert(j >= 0); assert(i < n); //Same for this one; ..... } ``` ``` double Matrix_Periodic_Banded::get_element(int const i, int j) const { assert(i >= 0); assert(i < n); assert(j >= 0); assert(i < n); //Same for this one; ..... } ``` ``` void Matrix_Periodic_Banded::set_element(int const i, int j, double const a_ij) { assert(i >= 0); assert(i < n); assert(j >= 0); assert(i < n); //Same for this one; ....... } ```
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.
Fix: correct column index assertion in Matrix_Corner_Block and Matrix_Periodic_Banded #566
In
src/matrix_tools/matrix_corner_block.cppandsrc/matrix_tools/matrix_periodic_banded.cppboth get_element and set_element contain same assert twice assert(i < n); and not the check for j any. This maybe copy-paste typo accidentally.and
Please complete the checklist to ensure that all tasks are completed before marking your pull request as ready for review.
All Submissions
New Feature Submissions
Changes to Existing Features
Changes to the CI