Skip to content

Commit 793a9a6

Browse files
committed
add conj!
1 parent 6665596 commit 793a9a6

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/linearalgebra.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ end
4545

4646
# Vector space functions
4747
#------------------------
48+
function Base.conj!(x::SparseArray)
49+
conj!(x.data.vals)
50+
return x
51+
end
4852
function LinearAlgebra.mul!(dst::SparseArray, a::Number, src::SparseArray)
4953
_zero!(dst)
5054
for (k, v) in nonzero_pairs(src)

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ end
5454
@test @constinferred(ldiv!(β, copy(ar))) == ldiv!(β, Array(ar)) β \ ar
5555
@test @constinferred(rdiv!(copy(ac), α)) == rdiv!(Array(ac), α) ac / α
5656
@test @constinferred(rdiv!(copy(ac), β)) == rdiv!(Array(ac), β) ac / β
57+
@test @constinferred(conj!(copy(ac))) == conj!(Array(ac))
5758
@test_throws InexactError rmul!(copy(ar), α)
5859
@test_throws InexactError ldiv!(α, copy(ar))
5960

0 commit comments

Comments
 (0)