Commit 58bf1e1
Compute inverse of
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
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
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
```
---------
Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>Cholesky with a single solve (#1326)1 parent 2060415 commit 58bf1e1
2 files changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
0 commit comments