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

add dispatch for dot between Symmetric and Hermitian #236

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions src/dispatch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,15 @@ function LinearAlgebra._dot_nonrecursive(
return fused_map_reduce(add_mul, lhs, rhs)
end

function LinearAlgebra.dot(
lhs::AbstractArray{<:AbstractMutable},
rhs::AbstractArray,
)
return operate(LinearAlgebra.dot, lhs, rhs)
end

function LinearAlgebra.dot(
lhs::AbstractArray,
rhs::AbstractArray{<:AbstractMutable},
)
return operate(LinearAlgebra.dot, lhs, rhs)
end

function LinearAlgebra.dot(
lhs::AbstractArray{<:AbstractMutable},
rhs::AbstractArray{<:AbstractMutable},
)
return operate(LinearAlgebra.dot, lhs, rhs)
for types in (LinearAlgebra.Symmetric, LinearAlgebra.Hermitian, AbstractArray)
type_pairs = (types, types{<:AbstractMutable})
for T in type_pairs, S in type_pairs
if T <: types{<:AbstractMutable} || S <: types{<:AbstractMutable}
function LinearAlgebra.dot(lhs::T, rhs::S)
return operate(LinearAlgebra.dot, lhs, rhs)
end
end
end
end

# Special-case because the the base version wants to do
Expand Down