Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added kron for Diagonal matrices #27581

Merged
merged 2 commits into from
Jun 29, 2018
Merged

Added kron for Diagonal matrices #27581

merged 2 commits into from
Jun 29, 2018

Conversation

jebej
Copy link
Contributor

@jebej jebej commented Jun 14, 2018

No description provided.

Copy link
Member

@Sacha0 Sacha0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from a rapid skim! Thanks @jebej! :)

function kron(A::Diagonal{T1}, B::Diagonal{T2}) where {T1<:Number, T2<:Number}
valA = A.diag; nA = length(valA)
valB = B.diag; nB = length(valB)
valC = Vector{typeof(zero(T1)*zero(T2))}(nA*nB)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add undef here

@jebej
Copy link
Contributor Author

jebej commented Jun 18, 2018

This is ready to be merged, although it could wait after 0.7 since it's not a breaking change (unless someone was relying on the fact that this used to return an Array and not a Diagonal).

@StefanKarpinski
Copy link
Sponsor Member

No harm merging once it passes tests by the same token—it doesn't break anything and it's uncontroversial, so why not?

@andreasnoack andreasnoack merged commit 143748d into JuliaLang:master Jun 29, 2018
@jebej jebej deleted the kron-diagonal branch July 4, 2018 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants