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

Multiplication of ScalMat and FillArray is ambiguous #1925

Closed
Wu-Chenyang opened this issue Dec 13, 2024 · 2 comments
Closed

Multiplication of ScalMat and FillArray is ambiguous #1925

Wu-Chenyang opened this issue Dec 13, 2024 · 2 comments

Comments

@Wu-Chenyang
Copy link

Wu-Chenyang commented Dec 13, 2024

The following code runs into errors.

julia> using PDMats, Distributions, LinearAlgebra
julia> ScalMat(3, 1) * MvNormal(I(3))
ERROR: MethodError: *(::ScalMat{Int64}, ::Falses{1, Tuple{Base.OneTo{Int64}}}) is ambiguous.

Candidates:
  *(a::ScalMat, x::AbstractVector)
    @ PDMats ~/.julia/packages/PDMats/cAM9h/src/scalmat.jl:43
  *(a::AbstractMatrix{T}, b::FillArrays.AbstractZeros{T, 1} where T) where T
    @ FillArrays ~/.julia/packages/FillArrays/lVl4c/src/fillalgebra.jl:103

Possible fix, define
  *(::ScalMat{T}, ::FillArrays.AbstractZeros{T, 1} where T) where T<:Real

This is due to the compatibility issue of ScalMat and FillArrays and can be fixed by, e.g., replacing the Falses(3) mean vector with zeros(3) or the ScalMat(3, 1) with I(3). Maybe I should submit this issue to FillArrays or PDMats?

@Wu-Chenyang Wu-Chenyang changed the title Multiplication is ambiguous Multiplication of ScalMat and FillArray is ambiguous Dec 13, 2024
@devmotion
Copy link
Member

Yes, to me this seems to be an issue of FillArrays + PDMats. Note that FillArrays already has an extension for PDMats, so IMO the missing method should be defined there.

@Wu-Chenyang
Copy link
Author

Thanks for your helpful response! I'll close this issue and submit it to FillArrays.

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

No branches or pull requests

2 participants