Skip to content

Commit

Permalink
Define dot product between Number and AbstractArray
Browse files Browse the repository at this point in the history
  • Loading branch information
Evey Dee committed Jun 16, 2017
1 parent 887064e commit d46cdc7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base/linalg/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,9 @@ vecdot(x::Number, y::Number) = conj(x) * y

dot(x::Number, y::Number) = vecdot(x, y)

dot(x::Number, y::AbstractArray) = conj(x) * y
dot(x::AbstractArray, y::Number) = ctranspose(x) * y

"""
dot(x, y)
⋅(x,y)
Expand Down

0 comments on commit d46cdc7

Please sign in to comment.