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

fix matrix multiplication interaction with HermOrSym and Diagonal #22474

Merged
merged 1 commit into from
Jun 24, 2017

Conversation

fredrikekre
Copy link
Member

@@ -150,9 +150,9 @@ end
(*)(D::Diagonal, B::AbstractTriangular) = A_mul_B!(D, copy(B))

(*)(A::AbstractMatrix, D::Diagonal) =
scale!(similar(A, promote_op(*, eltype(A), eltype(D.diag))), A, D.diag)
scale!(similar(A, promote_op(*, eltype(A), eltype(D.diag)), size(A)), A, D.diag)
Copy link
Member Author

@fredrikekre fredrikekre Jun 22, 2017

Choose a reason for hiding this comment

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

This fix is a bit dirty; currently similar(A::Symmetric) return a Matrix iff you supply both a new element type and size, can we rely on this behavior?
Ref: #19016 #15198 and #13731

Copy link
Member Author

Choose a reason for hiding this comment

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

Seem like this is used elsewhere also, so I think this is OK.

Copy link
Contributor

Choose a reason for hiding this comment

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

There are some ongoing open API issues between similar vs "copystructure" but for now I think it's okay

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! :)

@andreasnoack andreasnoack merged commit 0990d9b into JuliaLang:master Jun 24, 2017
@fredrikekre
Copy link
Member Author

Thanks for reviewing/merging.

@fredrikekre fredrikekre deleted the fe/sym-herm-diag branch June 25, 2017 02:16
ararslan pushed a commit that referenced this pull request Sep 11, 2017
ararslan pushed a commit that referenced this pull request Sep 13, 2017
vtjnash pushed a commit that referenced this pull request Sep 14, 2017
ararslan pushed a commit that referenced this pull request Sep 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants