JuliaStats / PDMats.jl

Uniform Interface for positive definite matrices of various structures
Other
104 stars 43 forks source link

Missing Method for StaticArrays #167

Open btmit opened 2 years ago

btmit commented 2 years ago

Looks like there are still a few things hiding out that use Matrix instead of AbstractMatrix.

Here's one example:

julia> a=PDMat(SMatrix{3,3}([ 0.880022  0.646205  0.598234
        0.646205  0.578793  0.449772
        0.598234  0.449772  1.33728]))
3×3 PDMat{Float64, SMatrix{3, 3, Float64, 9}}:
 0.880022  0.646205  0.598234
 0.646205  0.578793  0.449772
 0.598234  0.449772  1.33728

julia> b = PDiagMat(SVector{3}([0.558713 0.384665 0.469067]))
3×3 PDiagMat{Float64, SVector{3, Float64}}:
 0.558713  0.0       0.0
 0.0       0.384665  0.0
 0.0       0.0       0.469067

julia> a+b
ERROR: MethodError: no method matching _adddiag(::SMatrix{3, 3, Float64, 9}, ::SVector{3, Float64})

However, a+a and b+b work. So does a+b when both are constructing from normal matrices.