]> OCCT Git - occt.git/commit
Foundation Classes - Precompute Jacobi coefficients (#778)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Sun, 2 Nov 2025 11:22:34 +0000 (11:22 +0000)
committerGitHub <noreply@github.com>
Sun, 2 Nov 2025 11:22:34 +0000 (11:22 +0000)
commit7e9b74cc3194989e6f6c5c84c2d8277e0c411ae8
tree0cdecf3bfc4ccab653334b9d6ab23a35053e0f4d
parentb30cee01250d45c78d1ff37bf97e90b1aad29f73
Foundation Classes - Precompute Jacobi coefficients (#778)

- Add PLib_JacobiPolynomial_Coeffs.pxx with large constexpr tables and a JacobiCoefficientsCache + GetJacobiCoefficients() fast lookup to serve precomputed TNorm/CofA/CofB/Denom arrays for all constraint levels and degrees.
- Replace several runtime-initialized per-instance arrays/handles with zero-overhead constexpr data; remove myTNorm/myCofA/myCofB/myDenom handles from the class.
- Modernize PLib_JacobiPolynomial implementation:
  - Use constructor initializer list and validate inputs there.
  - Use constexpr lookup tables for weights/transforms and memcpy/std::fill_n to speed copying into TColStd arrays.
  - Replace switch-based pointer selection with indexed arrays for cleaner selection of DB pointers.
  - Simplify numerical loops, make offsets/indices const where possible and use clearer variable names.
  - Use GetJacobiCoefficients() in D0123 (and callers) to remove on-demand initialization and reduce per-call overhead.
- Change static data types to constexpr double for stronger optimization and clearer intent.
- Various micro-optimizations and safety fixes (avoid NULL, tighten const correctness) to improve performance and reduce runtime allocations.
src/FoundationClasses/TKMath/GTests/PLib_JacobiPolynomial_Test.cxx
src/FoundationClasses/TKMath/PLib/FILES.cmake
src/FoundationClasses/TKMath/PLib/PLib_JacobiPolynomial.cxx
src/FoundationClasses/TKMath/PLib/PLib_JacobiPolynomial.hxx
src/FoundationClasses/TKMath/PLib/PLib_JacobiPolynomial.lxx [deleted file]
src/FoundationClasses/TKMath/PLib/PLib_JacobiPolynomial_Coeffs.pxx [new file with mode: 0644]
src/FoundationClasses/TKMath/PLib/PLib_JacobiPolynomial_Data.pxx