From e6168b79b03bcdc1503653578867835c45e0c6a8 Mon Sep 17 00:00:00 2001 From: Marco Lombardi Date: Mon, 27 May 2024 18:34:01 +0200 Subject: [PATCH] inv(::Cholesky) always symmetric Forcing the symmetry of inv(::Cholesky) --- src/cholesky.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cholesky.jl b/src/cholesky.jl index 788447876..c2180248f 100644 --- a/src/cholesky.jl +++ b/src/cholesky.jl @@ -70,7 +70,8 @@ end LinearAlgebra.hermitian_type(::Type{SA}) where {T, S, SA<:SArray{S,T}} = Hermitian{T,SA} function inv(A::Cholesky{T,<:StaticMatrix{N,N,T}}) where {N,T} - return A.U \ (A.U' \ SDiagonal{N}(I)) + B = A.U \ (A.U' \ SDiagonal{N}(I)) + return (B .+ B') ./ T(2) end function Base.:\(A::Cholesky{T,<:StaticMatrix{N,N,T}}, B::StaticVecOrMatLike) where {N,T}