Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions stdlib/LinearAlgebra/src/rowvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ struct RowVector{T,V<:AbstractVector} <: AbstractMatrix{T}
end
end
const ConjRowVector{T,CV<:ConjVector} = RowVector{T,CV}

# Issue #24590: an inner product on a vector space induces an inner product on the dual space.
dot(x::Transpose{<:AbstractVector{<:Number}}, y::Transpose{<:AbstractVector{<:Number}}) = dot(transpose(x), transpose(y))
dot(x::Adjoint{<:AbstractVector{<:Number}}, y::Adjoint{<:AbstractVector{<:Number}}) = dot(adjoint(y), adjoint(x)) # note order (y,x): this is to get the correct conjugation
8 changes: 8 additions & 0 deletions stdlib/LinearAlgebra/test/adjtrans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -460,4 +460,12 @@ end
@test B == A .* A'
end

@testset "Issue #24590" begin
for T in (Transpose, Adjoint)
@test dot(T([1, 2, 3, 4]), T([2, 3, 6, 10])) == 66
@test dot(T([1, 2, 3, 4]), (1+2im)*T([2, 3, 6, 10])) == (1+2im)*66
@test dot((1+2im)*T([1, 2, 3, 4]), T([2, 3, 6, 10])) == (1-2im)*66
end
end

end # module TestAdjointTranspose