Skip to content

add constexpr for math operations#5798

Merged
hjmjohnson merged 2 commits intomainfrom
add-constexpr-for-math-operations
Feb 16, 2026
Merged

add constexpr for math operations#5798
hjmjohnson merged 2 commits intomainfrom
add-constexpr-for-math-operations

Conversation

@hjmjohnson
Copy link
Member

@hjmjohnson hjmjohnson commented Feb 13, 2026

  • ENH: Simplify itk::Math prime-related functions with constexpr
  • **ENH: Convert itkMathTest to itkMathGTest

PR Checklist

  • No API changes were made (or the changes have been approved)
  • No major design changes were made (or the changes have been approved)
  • Added test (or behavior not changed)

@github-actions github-actions bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module labels Feb 13, 2026
Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good on a glance.

@hjmjohnson hjmjohnson force-pushed the add-constexpr-for-math-operations branch from d2b3b7e to 7583f8e Compare February 13, 2026 19:37
- Removed redundant definitions of `IsPrime` and `GreatestPrimeFactor`
  in `itkMath.cxx` by incorporating template-based implementations in
  `itkMath.h`.
- Improved compile-time evaluation and type safety with `constexpr` and
  `std::enable_if_t`.
- Updated tests to leverage the new `constexpr` `itk::Math` functions.
- Enhanced maintainability by consolidating code and leveraging modern C++ features.
Use GTest framework for testing the math functions.
@hjmjohnson hjmjohnson force-pushed the add-constexpr-for-math-operations branch from 654b48f to 532b323 Compare February 14, 2026 02:34
@hjmjohnson hjmjohnson marked this pull request as ready for review February 14, 2026 02:51
@hjmjohnson hjmjohnson requested a review from dzenanz February 14, 2026 02:51
@hjmjohnson hjmjohnson self-assigned this Feb 14, 2026
@hjmjohnson
Copy link
Member Author

/azp run ITK.macOS.Python

@hjmjohnson hjmjohnson merged commit 038018d into main Feb 16, 2026
18 checks passed
@hjmjohnson hjmjohnson deleted the add-constexpr-for-math-operations branch February 16, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants