Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve SparsePoly evaluation #1815

Merged
merged 1 commit into from
Oct 1, 2024
Merged

feat: improve SparsePoly evaluation #1815

merged 1 commit into from
Oct 1, 2024

Conversation

thofma
Copy link
Member

@thofma thofma commented Sep 30, 2024

No description provided.

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@956093d). Learn more about missing BASE report.
Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1815   +/-   ##
=========================================
  Coverage          ?   88.03%           
=========================================
  Files             ?      119           
  Lines             ?    29993           
  Branches          ?        0           
=========================================
  Hits              ?    26403           
  Misses            ?     3590           
  Partials          ?        0           

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

r *= b^(reinterpret(Int, a.exps[a.length - i + 1] - a.exps[a.length - i]))
r += a.coeffs[a.length - i]
r = mul!(r, r, b^(reinterpret(Int, a.exps[a.length - i + 1] - a.exps[a.length - i])))
r = addeq!(r, r, a.coeffs[a.length - i])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
r = addeq!(r, r, a.coeffs[a.length - i])
r = add!(r, r, a.coeffs[a.length - i])

Copy link
Member

Choose a reason for hiding this comment

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

addeq! is deprecated

for i = 1:a.length - 1
r *= b^(reinterpret(Int, a.exps[a.length - i + 1] - a.exps[a.length - i]))
r += a.coeffs[a.length - i]
r = mul!(r, r, b^(reinterpret(Int, a.exps[a.length - i + 1] - a.exps[a.length - i])))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
r = mul!(r, r, b^(reinterpret(Int, a.exps[a.length - i + 1] - a.exps[a.length - i])))
r = mul!(r, b^(reinterpret(Int, a.exps[a.length - i + 1] - a.exps[a.length - i])))

you can make use of the shorthand if the first and second arg are identical (at most of the changed places)

@thofma thofma merged commit 3296e67 into master Oct 1, 2024
30 checks passed
@thofma thofma deleted the th/eval branch October 1, 2024 12:59
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.

3 participants