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

F32 support #5

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

F32 support #5

wants to merge 2 commits into from

Conversation

martinber
Copy link

This my try for #4.

The first commit implements it only for the FFT in the slice module which is the only case I'm interested to use, but I also tried to do it for the entire library in the second commit.

Regarding the first commit:

  • I had to add the Default trait because it was used in some functions. An alternative I think is to replace every T::default() with a T::zero() since FftNum implements the Zero trait
  • I added a quick test to see if at least is compiles for f32 and f64

Regarding the second commit:

  • Apparently for ndarray module we also need the Clone trait, unless we change a bit the code
  • Something similar happens in the slice::dct where we need Copy, but I guess it is fixable

Anyway, I leave up to you to think if adding all of these parametrizations make sense. I wonder if this change will make problems for users since we are changing the API. Maybe we can modify things a bit so we do not need the Default, Copy and Clone traits, leaving only the FftNum and DctNum traits as required

In any case, I'm just evaluating Rust for some application and needed f32 2D FFTs support, if there is no interest in this I guess I will make a small fork that only includes the 5 functions of the slice module

Thank you in any case!

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.

1 participant