Skip to content

Commit

Permalink
Merge pull request #105 from tpapp/tp/minor_corr_cholesky_static_fixes
Browse files Browse the repository at this point in the history
Minor fixes for static correlation Cholesky factor.
  • Loading branch information
tpapp committed Feb 21, 2023
2 parents 53841b0 + 395036c commit dd71203
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TransformVariables"
uuid = "84d833dd-6860-57f9-a1a7-6da5db126cff"
authors = ["Tamas K. Papp <tkpapp@gmail.com>"]
version = "0.8.0"
version = "0.8.1"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
2 changes: 1 addition & 1 deletion src/aggregation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function transform_with(flag::LogJacFlag, transformation::StaticArrayTransformat
+= ℓΔ
y
end
for _ in 1:D), ℓ
for _ in 1:D), ℓ, index
end

function inverse_eltype(transformation::Union{ArrayTransformation,StaticArrayTransformation},
Expand Down
12 changes: 9 additions & 3 deletions src/special_arrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,15 @@ end
function transform_with(flag::LogJacFlag, transformation::StaticCorrCholeskyFactor{D,S},
x::AbstractVector{T}, index) where {D,S,T}
# NOTE: add an unrolled version for small sizes
U, ℓ, index′ = calculate_corr_cholesky_factor!(zero(MMatrix{S,S,robust_eltype(x)}),
flag, x, index)
UpperTriangular(SMatrix(U)), ℓ, index′
E = robust_eltype(x)
U = if isbitstype(E)
zero(MMatrix{S,S,robust_eltype(x)})
else
# NOTE: currently allocating because non-bitstype based AD (eg ReverseDiff) does not work with MMatrix
zeros(E, S, S)
end
U, ℓ, index′ = calculate_corr_cholesky_factor!(U, flag, x, index)
UpperTriangular(SMatrix{S,S}(U)), ℓ, index′
end

inverse_eltype(t::Union{CorrCholeskyFactor,StaticCorrCholeskyFactor}, U::UpperTriangular) = robust_eltype(U)
Expand Down

2 comments on commit dd71203

@tpapp
Copy link
Owner Author

@tpapp tpapp commented on dd71203 Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/78161

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.1 -m "<description of version>" dd71203f0289d8989b2494477e53b5fa588c110c
git push origin v0.8.1

Please sign in to comment.