Skip to content

simplified BernsteinBasisOnSimplex - #1330

Merged
JordiManyer merged 4 commits into
masterfrom
simplify-BernsteinBasisOnSimplex
Aug 5, 2026
Merged

simplified BernsteinBasisOnSimplex#1330
JordiManyer merged 4 commits into
masterfrom
simplify-BernsteinBasisOnSimplex

Conversation

@Antoinemarteau

Copy link
Copy Markdown
Member

I removed the possibility of not storing a change of coordinate matrix (cartesian to barycentric) in BernsteinBasisOnSimplex.

This was an optimization for computations on reference simplices, but I realized it is complitely negligible and made the types of BernsteinBasisOnSimplex and BarycentricP(m)ΛBasis unecessarily complicated.

Now, the x_to_λ matrix is always stored, as a Matrix{Float64} instead of SMatrix, and SizedArray is used to cast the Matrix into a StaticArray to avoid allocations (and enable speed) in _cart_to_bary.

The Float64 hard-code leads to promotion to 64bits arithmetic for all evaluation of BernsteinBasisOnSimplex and P(m)Λ Bases. But the type parameters of both struct are way simpler now, the former B=BernsteinBasisOnSimplex{D,V,K} parameter is completely removed from P(m)Λ bases now.

I removed the possibility of not storing a change of coordinate matrix
(cartesian to barycentric) in BernsteinBasisOnSimplex.

This was an optimization for computations on reference simplices, but
I realized it is complitely negligible and made the types of
BernsteinBasisOnSimplex and BarycentricP(m)ΛBasis unecessarily
complicated.

Now, the x_to_λ matrix is always stored, as a Matrix{Float64} instead of
SMatrix, and SizedArray is used to cast the Matrix into a StaticArray to
avoid allocations (and enable speed) in `_cart_to_bary`.

The Float64 hard-code leads to promotion to 64bits arithmetic for all
evaluation of BernsteinBasisOnSimplex and P(m)Λ Bases. But the type
parameters of both struct are way simpler now, the former
B=BernsteinBasisOnSimplex{D,V,K} parameter is completely removed from P(m)Λ bases
now.
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.36842% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.83%. Comparing base (3f14453) to head (e628ca1).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/Polynomials/BarycentricPΛBases.jl 97.77% 1 Missing ⚠️
src/Polynomials/BernsteinBases.jl 96.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1330      +/-   ##
==========================================
- Coverage   88.85%   88.83%   -0.02%     
==========================================
  Files         228      228              
  Lines       30197    30132      -65     
==========================================
- Hits        26832    26769      -63     
+ Misses       3365     3363       -2     
Flag Coverage Δ
drivers 39.52% <51.31%> (+0.15%) ⬆️
extensions 5.00% <0.00%> (+0.01%) ⬆️
unit-adaptivity 40.16% <50.00%> (+0.20%) ⬆️
unit-basics 14.41% <0.00%> (+0.03%) ⬆️
unit-celldata 20.87% <0.00%> (+0.04%) ⬆️
unit-fespaces-1 32.66% <52.63%> (+0.04%) ⬆️
unit-fespaces-2 39.40% <0.00%> (+0.08%) ⬆️
unit-fields 17.28% <94.73%> (-0.18%) ⬇️
unit-geometry 28.42% <0.00%> (+0.06%) ⬆️
unit-multifield 30.48% <0.00%> (+0.06%) ⬆️
unit-odes 28.36% <0.00%> (+0.06%) ⬆️
unit-referencefes 33.96% <65.78%> (+0.07%) ⬆️
unit-visualization 11.69% <0.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Antoinemarteau

Copy link
Copy Markdown
Member Author

@JordiManyer this is ready.
Both broken tests don't seam to be related to the changes as far as I can tell.

@JordiManyer
JordiManyer merged commit 9bc344b into master Aug 5, 2026
56 of 58 checks passed
@JordiManyer
JordiManyer deleted the simplify-BernsteinBasisOnSimplex branch August 5, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants