-
Notifications
You must be signed in to change notification settings - Fork 8
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
*(::AbstractArray, ::AbstractArray) is wrong #175
Comments
We could replace |
I still think that there's an issue we can't resolve: julia> y = Vector{Union{Int,Float64}}([1, 1.5])
2-element Vector{Union{Float64, Int64}}:
1.0
1.5
julia> y = Union{Int,Float64}[1, 1.5]
2-element Vector{Union{Float64, Int64}}:
1
1.5
julia> y * y'
2×2 Matrix{Real}:
1 1.5
1.5 2.25
julia> y' * y
3.25
|
I have a very simple fix that I'm just testing 😄 |
Urgh. Even julia> M = LinearAlgebra.LowerTriangular
LowerTriangular
julia> T = Union{Int,Float64}
Union{Float64, Int64}
julia> x = M(T[1 2.5; 3.5 4])
2×2 LowerTriangular{Union{Float64, Int64}, Matrix{Union{Float64, Int64}}}:
1 ⋅
3.5 4
julia> x * x
ERROR: InexactError: Int64(3.5)
Stacktrace:
[1] Int64
@ ./float.jl:723 [inlined]
[2] convert
@ ./number.jl:7 [inlined]
[3] setindex!
@ ./array.jl:843 [inlined]
[4] copyto_unaliased!(deststyle::IndexLinear, dest::Matrix{Int64}, srcstyle::IndexCartesian, src::LowerTriangular{Union{Float64, Int64}, Matrix{Union{Float64, Int64}}})
@ Base ./abstractarray.jl:976
[5] copyto!
@ ./abstractarray.jl:950 [inlined]
[6] *(A::LowerTriangular{Union{Float64, Int64}, Matrix{Union{Float64, Int64}}}, B::LowerTriangular{Union{Float64, Int64}, Matrix{Union{Float64, Int64}}})
@ LinearAlgebra /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/triangular.jl:1522
[7] top-level scope
@ REPL[17]:1 |
Yes, LinearAlgebra will start creating a |
x-ref #174
These definitions place some very strong assumptions on the input types that are not present in
*(A, B)
:MutableArithmetics.jl/src/implementations/LinearAlgebra.jl
Lines 380 to 403 in 201aafb
For example, none of these work:
The text was updated successfully, but these errors were encountered: