Foundation Classes - Modernize TKMath with new packages#944
Merged
dpasukhi merged 6 commits intoOpen-Cascade-SAS:IRfrom Dec 22, 2025
Merged
Foundation Classes - Modernize TKMath with new packages#944dpasukhi merged 6 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi merged 6 commits intoOpen-Cascade-SAS:IRfrom
Conversation
This commit introduces several new packages and corresponding tests to the TKMath toolkit, enhancing its mathematical capabilities. Key changes include: 1. **New Packages**: - Added `MathUtils`, `MathPoly`, `MathLin`, `MathOpt`, `MathRoot`, and `MathSys` packages, each containing essential mathematical functions and algorithms. 2. **Integration of Tests**: - Comprehensive test files for each new package have been created, ensuring the correctness and reliability of the implemented algorithms. 3. **Documentation**: - README files for each package have been added, providing an overview and usage instructions. These additions aim to provide a robust foundation for mathematical operations within the OCCT framework, improving both functionality and user experience.
There was a problem hiding this comment.
Pull request overview
This pull request modernizes the TKMath toolkit by introducing six new packages with comprehensive mathematical algorithms and test coverage. The changes enhance OCCT's mathematical capabilities with modern C++17+ implementations of polynomial solvers, linear algebra, optimization, root finding, numerical integration, and nonlinear systems.
Key Changes
- Added six new packages: MathUtils, MathPoly, MathLin, MathOpt, MathRoot, MathSys, and MathInteg
- Implemented modern template-based algorithms with consistent result structures and error handling
- Added comprehensive test files for all new packages
Reviewed changes
Copilot reviewed 55 out of 82 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/FoundationClasses/TKMath/MathRoot/MathRoot_All.hxx | Root finding with null interval detection |
| src/FoundationClasses/TKMath/MathRoot/FILES.cmake | CMake configuration for MathRoot package |
| src/FoundationClasses/TKMath/MathPoly/README.md | Documentation for polynomial solvers |
| src/FoundationClasses/TKMath/MathPoly/MathPoly_Quartic.hxx | Quartic equation solver using Ferrari's method |
| src/FoundationClasses/TKMath/MathPoly/MathPoly_Quadratic.hxx | Linear and quadratic equation solvers |
| src/FoundationClasses/TKMath/MathPoly/MathPoly_Cubic.hxx | Cubic equation solver using Cardano's method |
| src/FoundationClasses/TKMath/MathPoly/FILES.cmake | CMake configuration for MathPoly package |
| src/FoundationClasses/TKMath/MathOpt/README.md | Documentation for optimization algorithms |
| src/FoundationClasses/TKMath/MathOpt/MathOpt_Uzawa.hxx | Constrained least squares solver |
| src/FoundationClasses/TKMath/MathOpt/MathOpt_Powell.hxx | Powell's conjugate direction method |
| src/FoundationClasses/TKMath/MathOpt/MathOpt_PSO.hxx | Particle swarm optimization |
| src/FoundationClasses/TKMath/MathOpt/MathOpt_Newton.hxx | Newton's method with Hessian |
| src/FoundationClasses/TKMath/MathOpt/MathOpt_GlobOpt.hxx | Global optimization strategies |
| src/FoundationClasses/TKMath/MathOpt/MathOpt_FRPR.hxx | Fletcher-Reeves-Polak-Ribiere conjugate gradient |
| src/FoundationClasses/TKMath/MathOpt/MathOpt_Brent.hxx | Brent's method for 1D minimization |
| src/FoundationClasses/TKMath/MathOpt/MathOpt_BFGS.hxx | BFGS quasi-Newton optimization |
| src/FoundationClasses/TKMath/MathOpt/FILES.cmake | CMake configuration for MathOpt package |
| src/FoundationClasses/TKMath/MathLin/README.md | Documentation for linear algebra solvers |
| src/FoundationClasses/TKMath/MathLin/MathLin_SVD.hxx | Singular value decomposition |
| src/FoundationClasses/TKMath/MathLin/MathLin_LeastSquares.hxx | Least squares solvers with multiple methods |
| src/FoundationClasses/TKMath/MathLin/MathLin_Jacobi.hxx | Jacobi eigenvalue decomposition |
| src/FoundationClasses/TKMath/MathLin/MathLin_Householder.hxx | QR decomposition using Householder reflections |
| src/FoundationClasses/TKMath/MathLin/MathLin_Gauss.hxx | LU decomposition with partial pivoting |
| src/FoundationClasses/TKMath/MathLin/MathLin_EigenSearch.hxx | QL algorithm for tridiagonal matrices |
| src/FoundationClasses/TKMath/MathLin/MathLin_Crout.hxx | Crout LDL^T decomposition for symmetric matrices |
| src/FoundationClasses/TKMath/MathLin/FILES.cmake | CMake configuration for MathLin package |
| src/FoundationClasses/TKMath/MathInteg/README.md | Documentation for numerical integration |
| src/FoundationClasses/TKMath/MathInteg/MathInteg_Set.hxx | Vector-valued function integration |
| src/FoundationClasses/TKMath/MathInteg/MathInteg_Multiple.hxx | Multi-dimensional Gauss integration |
| src/FoundationClasses/TKMath/MathInteg/MathInteg_Kronrod.hxx | Gauss-Kronrod quadrature with error estimation |
| src/FoundationClasses/TKMath/MathInteg/MathInteg_Gauss.hxx | Gauss-Legendre quadrature |
| src/FoundationClasses/TKMath/MathInteg/FILES.cmake | CMake configuration for MathInteg package |
| src/FoundationClasses/TKMath/GTests/FILES.cmake | Added test files for all new packages |
Updated mathematical comments in various test files to use the notation "~=" instead of "≈" for approximations. This change enhances consistency across the codebase and improves readability. Affected files include MathInteg_Comparison_Test.cxx, MathInteg_Test.cxx, MathOpt_NDim_Test.cxx, MathRoot_Multiple_Test.cxx, and MathRoot_Test.cxx.
…trix operations. This change simplifies the code by eliminating an unused function, enhancing maintainability.
…y with root count. Changed loop variable from size_t to int for better alignment with expected data types.
- Modified MathInteg_GaussTest to reflect the correct unsupported order (9) and updated comments to list all supported orders (3, 4, 5, 6, 7, 8, 10, 15, 21, 31). - Enhanced MathInteg_Gauss.hxx and MathInteg_Kronrod.hxx documentation to include the new supported quadrature points and weights. - Added new Gauss-Legendre points and weights for orders 4, 6, 8, 10, and 31 in MathUtils_Gauss.hxx, improving the integration capabilities of the library.
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.
This commit introduces several new packages and corresponding tests to the TKMath toolkit, enhancing its mathematical capabilities. Key changes include:
New Packages:
MathUtils,MathPoly,MathLin,MathOpt,MathRoot, andMathSyspackages, each containing essential mathematical functions and algorithms.Integration of Tests:
Documentation: