Skip to content

Conversation

@devmotion
Copy link
Contributor

Alternative to #1258 that instead of averaging out the errors of the two solves computes the inverse with a single solve and a symmetric matrix multiplication.

Checks of symmetry in the tests pass locally, and the example in the tests is even slightly faster:

This PR

julia> using StaticArrays, LinearAlgebra, Chairmarks

julia> @be cholesky((x -> x * x' + I)(@SMatrix(randn(3,3)))) inv
Benchmark: 3702 samples with 4741 evaluations
 min    4.561 ns
 median 5.018 ns
 mean   5.419 ns
 max    11.680 ns

master

julia> using StaticArrays, LinearAlgebra, Chairmarks

julia> @be cholesky((x -> x * x' + I)(@SMatrix(randn(3,3)))) inv
Benchmark: 3756 samples with 3276 evaluations
 min    6.983 ns
 median 7.326 ns
 mean   7.712 ns
 max    53.406 ns

Copy link
Collaborator

@mateuszbaran mateuszbaran left a comment

Choose a reason for hiding this comment

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

I think this is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants