-
Notifications
You must be signed in to change notification settings - Fork 35
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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!
src/polynomial/mod.rs
Outdated
/// 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"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
This PR closes issue #30