Skip to content

Commit

Permalink
Add specialized kron for sparse outer products
Browse files Browse the repository at this point in the history
  • Loading branch information
jmert committed Dec 26, 2018
1 parent 2c8c620 commit 2a85cba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stdlib/SparseArrays/src/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,9 @@ kron(x::SparseVector, A::SparseMatrixCSC) = kron(SparseMatrixCSC(x), A)
kron(A::Union{SparseVector,SparseMatrixCSC}, B::VecOrMat) = kron(A, sparse(B))
kron(A::VecOrMat, B::Union{SparseVector,SparseMatrixCSC}) = kron(sparse(A), B)

# sparse outer product
kron(A::SparseVectorUnion, B::AdjOrTransSparseVectorUnion) = A .* B

## det, inv, cond

inv(A::SparseMatrixCSC) = error("The inverse of a sparse matrix can often be dense and can cause the computer to run out of memory. If you are sure you have enough memory, please convert your matrix to a dense matrix.")
Expand Down

0 comments on commit 2a85cba

Please sign in to comment.