Skip to content

Commit

Permalink
Check that the abstract Cholesky algorithm respects non-commutative f…
Browse files Browse the repository at this point in the history
…ields
  • Loading branch information
mschauer committed Feb 20, 2015
1 parent 8c87a32 commit 5e70d46
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/linalg/cholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,15 @@ debug && println("pivoted Choleksy decomposition")
end
end
end

begin
# Cholesky factor of Matrix with non-commutative elements, here 2x2-matrices

X = Matrix{Float64}[0.1*rand(2,2) for i in 1:3, j = 1:3]
L = full(Base.LinAlg.chol!(X*X', :L))
U = full(Base.LinAlg.chol!(X*X', :U))
XX = full(X*X')

@test sum(sum(norm, L*L' - XX)) < eps()
@test sum(sum(norm, U'*U - XX)) < eps()
end

0 comments on commit 5e70d46

Please sign in to comment.