Skip to content

Commit

Permalink
bump compat entry for ConstructionBase.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
torfjelde committed Sep 8, 2023
1 parent 1e42770 commit 8b9e3e0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ AbstractPPL = "0.6"
BangBang = "0.3"
Bijectors = "0.13"
ChainRulesCore = "0.9.7, 0.10, 1"
ConstructionBase = "1"
ConstructionBase = "1.5.4"
Distributions = "0.23.8, 0.24, 0.25"
DocStringExtensions = "0.8, 0.9"
LogDensityProblems = "2"
Expand Down
23 changes: 0 additions & 23 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1081,26 +1081,3 @@ function varname_and_value_leaves_inner(vn::VarName, x::LinearAlgebra.UpperTrian
for I in CartesianIndices(x) if I[1] <= I[2]
)
end

# TODO: Remove as soon as https://github.com/JuliaObjects/ConstructionBase.jl/pull/80 goes through.
ConstructionBase.setproperties(C::LinearAlgebra.Cholesky, ::NamedTuple{()}) = C
function ConstructionBase.setproperties(C::LinearAlgebra.Cholesky, patch::NamedTuple{(:L,)})
return LinearAlgebra.Cholesky(
C.uplo === 'U' ? permutedims(patch.L) : patch.L, C.uplo, C.info
)
end
function ConstructionBase.setproperties(C::LinearAlgebra.Cholesky, patch::NamedTuple{(:U,)})
return LinearAlgebra.Cholesky(
C.uplo === 'L' ? permutedims(patch.U) : patch.U, C.uplo, C.info
)
end
function ConstructionBase.setproperties(
C::LinearAlgebra.Cholesky, patch::NamedTuple{(:UL,)}
)
return LinearAlgebra.Cholesky(patch.UL, C.uplo, C.info)
end
@nospecialize function ConstructionBase.setproperties(
C::LinearAlgebra.Cholesky, patch::NamedTuple
)
return error("Can only patch one of :L, :U, :UL at the time")
end

0 comments on commit 8b9e3e0

Please sign in to comment.