Skip to content

Fix idct for complex-valued bigfloat vectors #59

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

Merged
merged 2 commits into from
Dec 4, 2018
Merged

Fix idct for complex-valued bigfloat vectors #59

merged 2 commits into from
Dec 4, 2018

Conversation

daanhb
Copy link
Member

@daanhb daanhb commented Dec 4, 2018

The BigFloat implementation of idct was not correct for complex-valued vectors it seems, only when they happened to be of complex type but real-valued.
I changed the implementation to one that seems to work and added a few tests for this case.

I also had to change the threshold for another test involving BigFloat fft's, otherwise the test would fail in my setup.

@daanhb
Copy link
Member Author

daanhb commented Dec 4, 2018

Also, I don't think the implementation is correct for matrices, so I've restricted the arguments to be vectors.

@dlfivefifty
Copy link
Member

It fails in Julia v0.6.

@MikaelSlevinsky any complaints if we drop v0.6 support?

@MikaelSlevinsky
Copy link
Member

It's probably near time to drop support for 0.6, but it also seems arbitrary to drop it for a test that could be changed to complex.(big.(rand(...)),...) (to get random complex big floats), rather than a major refactor.

@MikaelSlevinsky
Copy link
Member

Thanks for the fix, btw!

@codecov-io
Copy link

Codecov Report

Merging #59 into master will decrease coverage by 31.76%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #59       +/-   ##
==========================================
- Coverage   84.47%   52.7%   -31.77%     
==========================================
  Files          33      33               
  Lines        3181    3157       -24     
==========================================
- Hits         2687    1664     -1023     
- Misses        494    1493      +999
Impacted Files Coverage Δ
src/fftBigFloat.jl 71.27% <75%> (-23.57%) ⬇️
src/ChebyshevUltrasphericalPlan.jl 45% <0%> (-55%) ⬇️
src/SphericalHarmonics/Butterfly.jl 36.59% <0%> (-53.75%) ⬇️
src/ChebyshevJacobiPlan.jl 46.39% <0%> (-53.61%) ⬇️
src/recurrence.jl 43.51% <0%> (-47.64%) ⬇️
src/SphericalHarmonics/synthesisanalysis.jl 52.65% <0%> (-43.62%) ⬇️
src/SphericalHarmonics/vectorfield.jl 42.48% <0%> (-41.64%) ⬇️
src/cheb2jac.jl 58.82% <0%> (-41.18%) ⬇️
src/SphericalHarmonics/thinplan.jl 49.67% <0%> (-40.65%) ⬇️
src/cheb2ultra.jl 59.45% <0%> (-40.55%) ⬇️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53ec4b0...a1d97ae. Read the comment docs.

@daanhb
Copy link
Member Author

daanhb commented Dec 4, 2018

I changed it to c = big.(rand(100)) + im*big.(rand(100)), in order to create a non-zero imaginary part (since that is where the error was). I agree this is not something to drop 0.6 for. However, the 0.6 tests still fail on my system with a "function range does not accept keyword arguments" error in another FFT test, which I did not change.

@MikaelSlevinsky
Copy link
Member

I think it's because positional arguments to range are in perhaps newer versions of Compat.jl

@MikaelSlevinsky MikaelSlevinsky merged commit 117a7c8 into JuliaApproximation:master Dec 4, 2018
@daanhb
Copy link
Member Author

daanhb commented Dec 5, 2018

That was it, I hadn't used 0.6 for a while!

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.

4 participants