Skip to content

Commit

Permalink
add imag for sparsematrix
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed May 27, 2017
1 parent 52e04a5 commit fe64bdc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/sparse/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,8 @@ sparse(S::UniformScaling, m::Integer, n::Integer=m) = speye_scaled(S.λ, m, n)
conj!(A::SparseMatrixCSC) = (@inbounds broadcast!(conj, A.nzval, A.nzval); A)
(-)(A::SparseMatrixCSC) = SparseMatrixCSC(A.m, A.n, copy(A.colptr), copy(A.rowval), map(-, A.nzval))

# the rest of real, conj, imag are handled correctly via AbstractArray methods
imag(A::SparseMatrixCSC{Tv,Ti}) where {Tv<:Number,Ti} = spzeros(Tv, Ti, A.m, A.n)

## Binary arithmetic and boolean operators
(+)(A::SparseMatrixCSC, B::SparseMatrixCSC) = map(+, A, B)
Expand Down

0 comments on commit fe64bdc

Please sign in to comment.