Code Monkey home page Code Monkey logo

Comments (5)

daanhb avatar daanhb commented on September 22, 2024 1

I'll make a pull request and then we can see.

from fasttransforms.jl.

MikaelSlevinsky avatar MikaelSlevinsky commented on September 22, 2024

Related: #34. Originally, I thought that someone from FFTW with connections to Julia might write native generic FFTs, but I suppose we can't wait forever.

from fasttransforms.jl.

daanhb avatar daanhb commented on September 22, 2024

Oops, I did not see the existing issue.

The generic FFT code works with other AbstractFloat types, but making them accessible for any AbstractFloat like I suggested above is not free of issues. For example, since dct is defined for Vectors in FastTransforms but for AbstractArrays (with any dimension) in FFTW, the definition of FastTransforms.jl is actually more specific. Hence, it ends up getting called, even when the argument has Float64 elements. Furthermore, the test suite yields StackOverflowErrors, presumably for a similar reason. For the time being, the code is here: https://github.com/daanhb/FastTransforms.jl/blob/genericfft/src/fftBigFloat.jl

from fasttransforms.jl.

daanhb avatar daanhb commented on September 22, 2024

The code now works and all tests pass, with some changes to the codeflow. I've renamed fft to generic_fft. The fft routines in AbstractFFTs.jl invoke plan_fft (and friends). We implement plan_fft with the same signature as in FFTW, but such that the methods of FFTW are more specific than ours when T is one of the fftwNumber types. We provide a fallback for any AbstractFloat. The dummy plans of FastTransforms subsequently call generic_fft (and friends).

So: fft (AbstractFFTs) -> plan_fft (FastTransforms) -> DummyFFTPlan.
The DummyFFTPlan calls generic_fft.

For Float64: fft (AbstractFFTs) -> plan_fft (FFTW) -> SomeFFTWPlan, much more efficient.

I've had to change the dummy plan for irfft to include the extra integer argument, which is the length of the original vector to which rfft was applied. I'll make a pull request.

from fasttransforms.jl.

MikaelSlevinsky avatar MikaelSlevinsky commented on September 22, 2024

Closed by #64

from fasttransforms.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.