JuliaStats / PDMats.jl

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

Fix too optimistic definitions of `*` and `/` with scalars #206

Open devmotion opened 2 months ago

devmotion commented 2 months ago

The definitions of * and / for pd matrices are too optimistic: In general, the resulting matrix is not pd (or psd) anymore, so we should not return a pd matrix type (which currently - at least some of them - do not even check positive definiteness at construction!).

If a pd matrix type is desired, then I guess either one should use a dedicated function or encode in the type domain of the scalar that it is positive (or at least non-negative).

Ref #201.