JuliaStats / PDMats.jl

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

LowerTriangular matrix multiplication for Static Vector missing #173

Closed bonStats closed 1 year ago

bonStats commented 1 year ago

MWE

using Distributions
using LinearAlgebra
using StaticArrays
using Random
d = 2
Σ = Matrix(1.0*I, d, d)
z = MVector{d, Float64}(undef)

rand!(Random.GLOBAL_RNG, MvNormal(Σ), z)

MethodError: no method matching lmul!(::LowerTriangular{Float64, Adjoint{Float64, Matrix{Float64}}}, ::MVector{2, Float64})

devmotion commented 1 year ago

I can't reproduce this error on Julia 1.9 and the latest versions of these packages. Maybe a path for this message was added in a recent version of StaticArrays?

Note though that this code mixes static and non-static arrays which is something you usually should avoid (note that LowerTriangular wraps an Adjoint of a Matrix). It seems ultimately you ended up with an error that is thrown at a lower level but not in PDMats, because it seems for you this linear algebra method was not defined for mixed non-static/static arrays.

bonStats commented 1 year ago

Thanks, I had old versions. And also, thanks for the tip about the LowerTriangular Matrix as a wrapper too!