Skip to content

Commit

Permalink
Fix vec of adjoint vector (#28568)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack authored Aug 12, 2018
1 parent 7cb8531 commit 04f4884
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/adjtrans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ similar(A::AdjOrTrans, ::Type{T}, dims::Dims{N}) where {T,N} = similar(A.parent,

# sundry basic definitions
parent(A::AdjOrTrans) = A.parent
vec(v::AdjOrTransAbsVec) = v.parent
vec(v::TransposeAbsVec) = parent(v)

cmp(A::AdjOrTransAbsVec, B::AdjOrTransAbsVec) = cmp(parent(A), parent(B))
isless(A::AdjOrTransAbsVec, B::AdjOrTransAbsVec) = isless(parent(A), parent(B))
Expand Down
4 changes: 3 additions & 1 deletion stdlib/LinearAlgebra/test/adjtrans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,10 @@ end

@testset "Adjoint and Transpose vector vec methods" begin
intvec = [1, 2]
@test vec(Adjoint(intvec)) === intvec
@test vec(Adjoint(intvec)) == intvec
@test vec(Transpose(intvec)) === intvec
cvec = [1 + 1im]
@test vec(cvec')[1] == cvec[1]'
end

@testset "horizontal concatenation of Adjoint/Transpose-wrapped vectors and Numbers" begin
Expand Down

0 comments on commit 04f4884

Please sign in to comment.