JuliaStats / PDMats.jl

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

Fix right division and add checks of dimensions #153

Closed devmotion closed 2 years ago

devmotion commented 2 years ago

To simplify reviewing and to avoid unrelated changes, I extracted the fixes of right division and additional checks of dimensions from https://github.com/JuliaStats/PDMats.jl/pull/152.

This addresses the issues discussed in https://github.com/JuliaStats/PDMats.jl/pull/131#issuecomment-805893449 and makes the behaviour of / consistent with LinearAlgebra. Moreover, the dimension checks prevent incorrect behaviour, e.g., currently the following "works":

julia> using PDMats

julia> ScalMat(4, 2.0) * ones(3)
3-element Vector{Float64}:
 2.0
 2.0
 2.0

julia> ScalMat(4, 2.0) * ones(3, 2)
3×2 Matrix{Float64}:
 2.0  2.0
 2.0  2.0
 2.0  2.0
devmotion commented 2 years ago

Bump :slightly_smiling_face: