Skip to content

Optimize geometric-domain Lagrange evaluation - #115

Merged
odraccir1 merged 6 commits into
masterfrom
ra/batch_inversion
Aug 7, 2026
Merged

Optimize geometric-domain Lagrange evaluation#115
odraccir1 merged 6 commits into
masterfrom
ra/batch_inversion

Conversation

@odraccir1

@odraccir1 odraccir1 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Add reusable linear-time barycentric precomputation to geometric_sequence_domain.

For a domain of size (m):

  • Construction takes (O(m)) field operations and one field inversion.
  • Evaluating all Lagrange weights at one point takes (O(m)) operations and one inversion.
  • Evaluating at (k) points takes (O(mk)) after domain construction.

The PR also includes

  • batch_inverse which is needed for the algorithm.
  • calculation of vanishing polynomial in linear time using the recurrence relation from the Gaussian-Binomial theorem

Related to #113

@odraccir1 odraccir1 changed the title Ra/batch inversion Optimize geometric-domain Lagrange evaluation Aug 6, 2026
@odraccir1
odraccir1 requested a review from spaceships August 6, 2026 23:22

@spaceships spaceships left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice, looks great!

*/
template<typename ValueType, typename Allocator>
[[nodiscard]] std::vector<ValueType, Allocator>
batch_inverse_nonzero(const std::vector<ValueType, Allocator> &values) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice, this is so fancy!

@odraccir1
odraccir1 merged commit a272e1f into master Aug 7, 2026
2 checks passed
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