PDMats.jl
PDMats.jl copied to clipboard
Positivity check in PDiagMat and ScalMat constructors?
At present there is no check for positivity of the arguments that will be on the diagonal of a PDiagMat or ScalMat. Probably a good idea to check that.
julia> using PDMats
julia> ScalMat(4,-1.5)
ScalMat(4,-1.5,-0.6666666666666666)
julia> PDiagMat([-1.,2.,-3.,4.])
PDiagMat(4,[-1.0,2.0,-3.0,4.0],[-1.0,0.5,-0.333333,0.25])
I think we need this. In particular now that we've also defined isposdef in https://github.com/JuliaStats/PDMats.jl/pull/123.