Skip to content

Commit

Permalink
Merge pull request #20971 from Sacha0/nixrowvecambigs
Browse files Browse the repository at this point in the history
resolve ambiguity between * methods
  • Loading branch information
Sacha0 authored Mar 12, 2017
2 parents 5e8f62c + 294b253 commit 6051590
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/linalg/rowvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ end

# inner product -> dot product specializations
@inline *{T<:Real}(rowvec::RowVector{T}, vec::AbstractVector{T}) = dot(parent(rowvec), vec)
@inline *{T<:Real}(rowvec::ConjRowVector{T}, vec::AbstractVector{T}) = dot(rowvec', vec)
@inline *(rowvec::ConjRowVector, vec::AbstractVector) = dot(rowvec', vec)

# Generic behavior
Expand Down
4 changes: 4 additions & 0 deletions test/linalg/rowvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,7 @@ end
@test A'*x' == A'*y == B*x' == B*y == C'
end
end

@testset "ambiguity between * methods with RowVectors and ConjRowVectors (#20971)" begin
@test RowVector(ConjArray(ones(4))) * ones(4) == 4
end

0 comments on commit 6051590

Please sign in to comment.