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

nxn Fill addition UniformScaling errors #170

Closed
theogf opened this issue Feb 1, 2022 · 4 comments · Fixed by #171
Closed

nxn Fill addition UniformScaling errors #170

theogf opened this issue Feb 1, 2022 · 4 comments · Fixed by #171

Comments

@theogf
Copy link

theogf commented Feb 1, 2022

Here is a MWE:

julia> K = Fill(1.0, 2, 2)
julia> K + 1e-6 * I
ERROR: ArgumentError: Cannot setindex! to 1.000001 for an AbstractFill with value 1.0.
Stacktrace:
 [1] setindex!
   @ ~/.julia/packages/FillArrays/Vzxer/src/FillArrays.jl:53 [inlined]
 [2] +(A::Fill{Float64, 2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, J::UniformScaling{Float64})
   @ LinearAlgebra ~/julia-1.7.1/share/julia/stdlib/v1.7/LinearAlgebra/src/uniformscaling.jl:219
 [3] top-level scope
   @ REPL[28]:1

Observed at JuliaGaussianProcesses/KernelFunctions.jl#432

@dlfivefifty
Copy link
Member

Always include the full stack trace as otherwise we can't see where the error is

@theogf
Copy link
Author

theogf commented Feb 1, 2022

Updated! Matrix addition with a UniformScaling creates a new matrix of the same type of the matrix and adds the values in place.

@dlfivefifty
Copy link
Member

OK so probably we need to overload +(::Fill, ::UniformScaling) and varients

@devmotion
Copy link
Contributor

I opened a PR that fixes the issue: #171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants