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

Two-arg dot #147

Closed
wants to merge 2 commits into from
Closed

Two-arg dot #147

wants to merge 2 commits into from

Conversation

mcabbott
Copy link
Contributor

There were some methods for dot(x,A,y), this adds similar ones for dot(x,y). Motivation:

julia> @btime dot($(rand(50,50)), Fill(1.0, 50, 50));
  2.329 μs (0 allocations: 0 bytes)

julia> @btime sum($(rand(50,50)));
  481.621 ns (0 allocations: 0 bytes)

I am a little concerned that methods with one ::AbstractArray argument are going to produce ambiguities, see what you think?

@dlfivefifty
Copy link
Member

It’s apparently possible to test for ambiguities:

#105

@mcabbott
Copy link
Contributor Author

Great, just saw that too. It found these, for which I've added methods like dot(a::Diagonal, b::AbstractFill{<:Any,2}):

 (dot(A::AbstractMatrix{T} where T, B::Diagonal) in LinearAlgebra at /Applications/Julia-1.6.app/Contents/Resources/julia/share/julia/stdlib/v1.6/LinearAlgebra/src/diagonal.jl:706, dot(a::FillArrays.AbstractFill, b::AbstractArray) in FillArrays at /Users/me/.julia/dev/FillArrays/src/fillalgebra.jl:145)
 (dot(D::Diagonal, B::AbstractMatrix{T} where T) in LinearAlgebra at /Applications/Julia-1.6.app/Contents/Resources/julia/share/julia/stdlib/v1.6/LinearAlgebra/src/diagonal.jl:701, dot(a::AbstractArray, b::FillArrays.AbstractFill) in FillArrays at /Users/me/.julia/dev/FillArrays/src/fillalgebra.jl:141)

@codecov
Copy link

codecov bot commented May 16, 2021

Codecov Report

Merging #147 (e296f22) into master (a7ce2f8) will increase coverage by 0.11%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #147      +/-   ##
==========================================
+ Coverage   95.66%   95.78%   +0.11%     
==========================================
  Files           4        4              
  Lines         531      546      +15     
==========================================
+ Hits          508      523      +15     
  Misses         23       23              
Impacted Files Coverage Δ
src/fillalgebra.jl 99.37% <100.00%> (+0.06%) ⬆️

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 a7ce2f8...e296f22. Read the comment docs.

@mcabbott mcabbott mentioned this pull request Jul 4, 2021
@mcabbott mcabbott closed this Nov 25, 2021
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.

2 participants