Skip to content

Commit

Permalink
Slight fenrir speed improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Feb 7, 2024
1 parent 0f5907f commit d9e01b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/data_likelihoods/fenrir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ function measure_and_update!(x, u, H, R::PSDMatrix, cache)
_matmul!(z, H, x.μ)
z .-= u
fast_X_A_Xt!(S, x.Σ, H)
_S = PSDMatrix(qr([S.R; R.R]).R)
# _S = PSDMatrix(S.R'S.R + R.R'R.R)
_S = PSDMatrix(triangularize!([S.R; R.R], cachemat=cache.C_DxD))
msmnt = Gaussian(z, _S)

return update!(x, copy!(cache.x_tmp, x), msmnt, H; R=R, cache)
Expand Down
5 changes: 5 additions & 0 deletions src/fast_linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ _matmul!(
A::Diagonal{T},
B::Diagonal{T},
) where {T<:LinearAlgebra.BlasFloat} = @.. C = A * B
_matmul!(
C::AbstractMatrix{T},
A::LowerTriangular{T},
B::UpperTriangular{T},
) where {T<:LinearAlgebra.BlasFloat} = mul!(C, A, B)

"""
getupperright!(A)
Expand Down

0 comments on commit d9e01b5

Please sign in to comment.