Generalize assertion helper for N dimensions #40
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.
This pull request introduces support for 4D linear interpolation in the codebase, including the addition of a
LinearInterp4Dclass, enhanced assertion helpers for N-dimensional interpolation, and comprehensive tests for 4D interpolation functionality. The changes improve code reusability, extend functionality to higher dimensions, and ensure robust testing.New functionality for 4D interpolation:
include/linear_interp.hpp: Added theLinearInterp4Dclass, which extendsLinearInterpNDto support 4-dimensional interpolation.Enhanced assertion helpers:
tests/assertion_helpers.hpp: Refactored interpolation assertion helpers into a reusableInterpNDAssertionsclass for N-dimensional interpolation, and added support for 4D assertions viaInterp4DAssertions.Comprehensive testing:
tests/test_linear_interp.cpp: Added multiple tests for 4D interpolation, including tests for linear, direct template-based, and non-linear functions. These ensure correctness and validate interpolation behavior at grid points and midpoints.tests/test_linear_interp.cpp: IntroducedVectorN4type alias for 4D vectors to facilitate testing.