Skip to content

Simplify multiple dispatch #187

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 1 commit into from
Jun 24, 2022
Merged

Simplify multiple dispatch #187

merged 1 commit into from
Jun 24, 2022

Conversation

dkarrasch
Copy link
Member

This removes those type annotations that are never used in multiple dispatch. The common pattern of input types and output types (AbstractVector -> AbstractVecOrMat, AbstractMatrix -> AbstractMatrix) is consistent with LinearAlgebra, and is checked for at the mul! level. Afterwards, in _unsafe_mul! the consistency of input and output types is never checked again. What matters is only (a) which map type we use, (b) to which array type we apply the map. In the 5-arg case, it is clear that mul! will only deliver Numbers as fourth and fifth argument. I believe this improves readability quite a bit. I have used the opportunity to (hopefully) clearify the docs even more.

@codecov
Copy link

codecov bot commented Jun 23, 2022

Codecov Report

Merging #187 (68872c1) into master (710a0d3) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 68872c1 differs from pull request most recent head 6d7e3f7. Consider uploading reports for the commit 6d7e3f7 to get more accurate results

@@            Coverage Diff             @@
##           master     #187      +/-   ##
==========================================
- Coverage   98.62%   98.60%   -0.03%     
==========================================
  Files          17       17              
  Lines        1381     1360      -21     
==========================================
- Hits         1362     1341      -21     
  Misses         19       19              
Impacted Files Coverage Δ
src/LinearMaps.jl 100.00% <100.00%> (ø)
src/blockmap.jl 99.27% <100.00%> (ø)
src/composition.jl 100.00% <100.00%> (ø)
src/embeddedmap.jl 68.75% <100.00%> (ø)
src/fillmap.jl 100.00% <100.00%> (ø)
src/functionmap.jl 100.00% <100.00%> (ø)
src/inversemap.jl 100.00% <100.00%> (ø)
src/kronecker.jl 98.47% <100.00%> (ø)
src/left.jl 100.00% <100.00%> (ø)
src/linearcombination.jl 100.00% <100.00%> (ø)
... and 4 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 710a0d3...6d7e3f7. Read the comment docs.

@dkarrasch dkarrasch merged commit 10b6901 into master Jun 24, 2022
@dkarrasch dkarrasch deleted the dk/reduce branch June 24, 2022 10:33
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