invenia / PDMatsExtras.jl

Extra Positive (Semi-)Definite Matricies
MIT License
8 stars 6 forks source link

Mimic constructor from PDMats.jl so that PSDMat(<:Matrix{<:Integer}) does not throw #34

Closed vandenman closed 1 year ago

vandenman commented 1 year ago

Per this discourse post, the following throws:

PSDMat([0 0; 0 1])
ERROR: MethodError: no method matching PSDMat{Int64, Matrix{Int64}}(::Int64, ::Matrix{Int64}, ::CholeskyPivoted{Float64, Matrix{Float64}, Vector{Int64}})

It also used to throw in PDMats.jl, but that was fixed in https://github.com/JuliaStats/PDMats.jl/pull/117. This PR copies the changes in that PR and adds a small test.

Technically this is probably a breaking change, but PDMats.jl merged that PR in a patch release so ¯\(ツ)

oxinabox commented 1 year ago

Thanks, sorry this slipped under the radar.

Can you rebase this, and then it should be good to merge

This isn't breaking. Per https://github.com/SciML/ColPrac#changes-that-are-not-considered-breaking

Exceptions may be replaced with non-error behavior.