Skip to content

Commit

Permalink
add specialized conj method for SparseVector
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed May 27, 2017
1 parent 9d8f105 commit 2f4ae4b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions base/sparse/sparsevector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,7 @@ end

# the rest of real, conj, imag are handled correctly via AbstractArray methods
@unarymap_nz2z_z2z real Complex
conj(x::SparseVector{<:Complex}) = SparseVector(length(x), copy(nonzeroinds(x)), conj(nonzeros(x)))
imag(x::AbstractSparseVector{Tv,Ti}) where {Tv<:Real,Ti<:Integer} = SparseVector(length(x), Ti[], Tv[])
@unarymap_nz2z_z2z imag Complex

Expand Down

0 comments on commit 2f4ae4b

Please sign in to comment.