Skip to content

Commit

Permalink
fix kron
Browse files Browse the repository at this point in the history
  • Loading branch information
GiggleLiu committed Dec 17, 2018
1 parent 27a3afe commit b272e33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kronecker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ end
kron(A::IMatrix{Na, Ta}, B::IMatrix{Nb, Tb}) where {Na, Nb, Ta, Tb}= IMatrix{Na*Nb, promote_type(Ta, Tb)}()
kron(A::IMatrix{Na}, B::Diagonal{<:Number}) where Na = Diagonal(orepeat(B.diag, Na))
kron(B::Diagonal{<:Number}, A::IMatrix{Na}) where Na = Diagonal(irepeat(B.diag, Na))
for MT in [:AbstractMatrix, :PermMatrix, :SparseMatrixCSC, :IMatrix, :(Diagonal{<:Number})]
@eval kron(A::IMatrix{1}, B::$MT) = B
@eval kron(B::$MT, A::IMatrix{1}) = B
for MT in [:AbstractMatrix, :PermMatrix, :SparseMatrixCSC, :Diagonal]
@eval kron(A::IMatrix{1}, B::$MT{<:Number}) = B
@eval kron(B::$MT{<:Number}, A::IMatrix{1}) = B
end

####### diagonal kron ########
Expand Down

0 comments on commit b272e33

Please sign in to comment.