Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds FillArrays as a weak dependency on Julia >= 1.9 and as a proper dependency on Julia < 1.9 (the latter might not be completely desirable, see #182 (comment), and alternatives would be to use Requires or reduce features on older Julia versions).
Currently, the only method in the extension is a definition of
AbstractPDMat
forDiagonal
matrices with anFillArray
as diagonal. This is motivated by the constructors ofMvNormal
in Distributions in https://github.com/JuliaStats/Distributions.jl/blob/87aebc29b2b9608801b70aae09fbc1d2dad56e3f/src/multivariate/mvnormal.jl#L201-L210: With the definition in this PR they could be simplified toThis pattern is more generally useful, I imagine: Downstream packages that deal with pd matrices could be encouraged to use
AbstractPDMat(...)
for converting user-provided matrices to an optimized representation. The PR here adds such optimizations also forDiagonal
withFillArray
s as diagonal.This is an alternative to #184 that keeps support for Julia 1.0. The issues with
Pkg.test
(incompatibilities of test dependencies with already installed package dependencies) can be avoided by enforcing the use of FillArrays 0.10 on Julia 1.0. Julia 1.0 is also supported by FillArrays 0.11 and 0.12 and hence I added them to the compat entry as well; however, the test dependencies BandedMatrices and ArrayLayouts can't be installed together with these more recent versions on Julia 1.0, hence I explicitly downgraded FillArrays to 0.10 in CI on Julia 1.0.