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: FFT and Ifft implemented with tests #221

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mahmudsudo
Copy link
Contributor

This PR closes issue #30

Copy link
Contributor

@Autoparallel Autoparallel left a comment

Choose a reason for hiding this comment

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

Do you mind looking into the change I suggested? Could help clean up code elsewhere too.

I will review more in depth later! Nice work!

/// Computes the Fast Fourier Transform (FFT) of a polynomial in the Monomial basis.
pub fn fft(&self) -> Polynomial<Lagrange<F>, F, D> {
let n = self.num_terms();
assert!(n.is_power_of_two(), "Length must be power of 2");
Copy link
Contributor

Choose a reason for hiding this comment

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

self.num_terms() is actually just D.

My suggestion would be to make note of this throughout this whole module and then we don't need assertions that get ran at runtime. We can instead just have compile time checking with const generics. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i tried some fix , but it might affect some tests

Copy link
Contributor Author

@mahmudsudo mahmudsudo Feb 18, 2025

Choose a reason for hiding this comment

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

@Autoparallel is the fix in anyway what you wanted , it will restrict creating non power of two numbered coefficient polynomials , hence the failing tests

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