Skip to content

Conversation

@elisno
Copy link

@elisno elisno commented Dec 7, 2018

My previous pull request broke existing functionality, so I decided to restart my work and add internal functions for arrays.

If the function is an N-dimensional array, its Laguerre-coefficients are stored in an (N+1)-dimensional array. The FFT is performed along the first dimension of that coefficient array when calculating the Laguerre-series.

In the test file specific to array-valued functions (test/arrayweeks_test.jl), calls to the internal functions seem to require two attempts (the first one usually outputs arrays of zeros). I haven't bothered to work on that, but I'll create a separate issue for that soon.

In the future I would overload _get_coefficients or the constructor 
Weeks to handle array valued Laplace functions.
Note: I'm unsure if the Weeks(func, ...) constructor should contain a 
parameter describing the dimensions of func. Right now I'll have to 
rewrite _get_coefficients when func gives an array.
Now I noticed that the 2x2 test case has been transposed, giving false 
test passes.
The isapprox(laguerreeval,...) test passes if the matrix [1 3; 2 4] is 
used, which is wrong.
Permutedims!(...) was supposed to only shift the last index to the first 
place. Previously, it incorrectly reversed the ordering of the indices 
(essentially giving a transposed FFT in the end).
The unit tests missed this since they were also written in a row-major 
order.
The tests now correctly test in a memory efficient way (column-major 
order) and some have been reduced to a single line.
Although this functionality is not in use, I noticed that 
_get_array_coefficients(w::Weeks{T}) would use the scalar method if 
called.
This has now been fixed.

To keep things simple for now, I'll ignore 
_set_array_coefficients(w::Weeks{T}).
eval_ilt(w::Weeks) works for scalar functions. It currently does not 
work for arrays, since the dimensionality of w.coefficients is unknown.

To test the ILT functionality for arrays, I'll calculate the 
coefficients directly and compare that with the scalar Weeks method.
@codecov-io
Copy link

codecov-io commented Dec 7, 2018

Codecov Report

Merging #8 into master will decrease coverage by 24.32%.
The diff coverage is 96.55%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master       #8       +/-   ##
===========================================
- Coverage     100%   75.67%   -24.33%     
===========================================
  Files           5        5               
  Lines         115      185       +70     
===========================================
+ Hits          115      140       +25     
- Misses          0       45       +45
Impacted Files Coverage Δ
src/weeks.jl 71.17% <96.55%> (-28.83%) ⬇️
src/InverseLaplace.jl 33.33% <0%> (-66.67%) ⬇️
src/pairtest.jl 75% <0%> (-25%) ⬇️
src/fixed_talbot.jl 95.83% <0%> (-4.17%) ⬇️

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 6262bf8...5b04403. Read the comment docs.

@jlapeyre
Copy link
Collaborator

jlapeyre commented Dec 7, 2018

Thanks! I will look at the changes. The test coverage went down even thought you added tests. Any idea why ?

@elisno
Copy link
Author

elisno commented Dec 7, 2018

Not really. Does this have something to do with the missing base report?
Could this have something to do with the style of the test file (let blocks)?

let arr = try InverseLaplace._arrcoeff(arrFcomplex,4,1.0,1.0);
InverseLaplace._arrcoeff(arrFcomplex,4,1.0,1.0)
catch
InverseLaplace._arrcoeff(arrFcomplex,4,1.0,1.0)
Copy link
Author

Choose a reason for hiding this comment

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

Is it necessary to test _arrcoeff if _get_array_coefficients is tested as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, it shouldn't be necessary. I don't know whats up. 100 % coverage before is suspicious. Still, it may be accurate.

Copy link
Author

Choose a reason for hiding this comment

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

I don't understand how the three lines in _wcoeff and _arrcoeff were missed, while the rest got multiple hits.

@jlapeyre
Copy link
Collaborator

jlapeyre commented Dec 7, 2018

Yeah, maybe the missing base report.

@elisno
Copy link
Author

elisno commented Dec 11, 2018

Others seem to have similar issues with coverage.
A fix seems to be on the way.

The coefficient-rank in the Weeks{T}-type is no longer declared
explicitly. Instead, it is supplied as an argument to the outer
constructor.

Array- and complex-tests have been reformatted and grouped into
testsets.
end

@testset "Array functionality" begin
@testset "Internal functions" begin
Copy link
Author

Choose a reason for hiding this comment

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

This testset "Internal functions" won't be necessary after the commit elisno@bd27190,
where the Weeks-type can is finally implemented for arrays.

@jlapeyre jlapeyre force-pushed the master branch 3 times, most recently from c95f98b to 5e6f821 Compare January 26, 2020 14:16
@codecov-commenter
Copy link

Codecov Report

Merging #8 into master will decrease coverage by 24.32%.
The diff coverage is 96.55%.

Impacted file tree graph

@@             Coverage Diff              @@
##            master       #8       +/-   ##
============================================
- Coverage   100.00%   75.67%   -24.33%     
============================================
  Files            5        5               
  Lines          115      185       +70     
============================================
+ Hits           115      140       +25     
- Misses           0       45       +45     
Impacted Files Coverage Δ
src/weeks.jl 71.17% <96.55%> (-28.83%) ⬇️
src/InverseLaplace.jl 33.33% <0.00%> (-66.67%) ⬇️
src/pairtest.jl 75.00% <0.00%> (-25.00%) ⬇️
src/fixed_talbot.jl 95.83% <0.00%> (-4.17%) ⬇️

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 0f590a8...db1eb6b. Read the comment docs.

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