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

mul! with Symmetric does not check sizes are compatible #928

Closed
sethaxen opened this issue Jun 3, 2022 · 0 comments · Fixed by JuliaLang/julia#45605
Closed

mul! with Symmetric does not check sizes are compatible #928

sethaxen opened this issue Jun 3, 2022 · 0 comments · Fixed by JuliaLang/julia#45605
Labels
backport 1.6 Change should be backported to release-1.6 backport 1.8 Change should be backported to release-1.8 bug Something isn't working

Comments

@sethaxen
Copy link
Contributor

sethaxen commented Jun 3, 2022

Here we define matrices A, B, and C with incompatible sizes for multiplication:

julia> using LinearAlgebra

julia> A = Symmetric(randn(5, 5));

julia> B = randn(10, 5);

julia> C = zeros(5, 5);

julia> mul!(C, A, B)
5×5 Array{Float64,2}:
  0.98847    1.64837    0.00974132  -4.00331    0.138057
 -2.00759   -1.08226   -0.240299     1.32073   -0.144493
  0.535827   0.125398  -0.53018     -0.385373  -0.146108
 -3.96372   -2.00857   -1.01928      4.40731    1.87013 
 -2.91995   -1.37546   -1.09736      4.79497    1.76239 
 
julia> A * B
5×5 Array{Float64,2}:
  0.98847    1.64837    0.00974132  -4.00331    0.138057
 -2.00759   -1.08226   -0.240299     1.32073   -0.144493
  0.535827   0.125398  -0.53018     -0.385373  -0.146108
 -3.96372   -2.00857   -1.01928      4.40731    1.87013 
 -2.91995   -1.37546   -1.09736      4.79497    1.76239 

Yet mul! (and *) works! I have confirmed that this has been the behavior since Julia 1.0.

@N5N3 N5N3 added bug Something isn't working backport 1.6 Change should be backported to release-1.6 backport 1.8 Change should be backported to release-1.8 labels Jun 3, 2022
@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.6 Change should be backported to release-1.6 backport 1.8 Change should be backported to release-1.8 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants