Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LU-factorize without pivoting for inv of Taylor1 matrices #223

Merged
merged 3 commits into from
Sep 6, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes tests for inv by shifting the diagonal
  • Loading branch information
lbenet committed Sep 6, 2019
commit a6200559b18c914d677e24dc45a463568092a1c2
25 changes: 13 additions & 12 deletions test/onevariable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -506,21 +506,22 @@ end

@testset "Test `inv` for `Matrix{Taylor1{Float64}}``" begin
t = Taylor1(5)
a = rand(3, 3)
b = a .+ zero(t)

a = Diagonal(rand(0:10,3)) + rand(3, 3)
b = Taylor1.(a, 5)
binv = inv(b)
I_t_5 = UniformScaling(one(Taylor1(5))) # 3x3 Taylor1{Float64} identity matrix, order 5
@test norm(b*binv - I_t_5, Inf) ≤ 1e-11
@test norm(binv*b - I_t_5, Inf) ≤ 1e-11
@test norm(triu(b)*inv(UpperTriangular(b)) - I_t_5, Inf) ≤ 1e-11
@test norm(inv(LowerTriangular(b))*tril(b) - I_t_5, Inf) ≤ 1e-11
@test norm(binv - inv(a), Inf) ≤ 1e-11
@test norm(b*binv - I, Inf) ≤ 1e-11
@test norm(binv*b - I, Inf) ≤ 1e-11
@test norm(triu(b)*inv(UpperTriangular(b)) - I, Inf) ≤ 1e-11
@test norm(inv(LowerTriangular(b))*tril(b) - I, Inf) ≤ 1e-11

b = a .+ t
b .= b .+ t
binv = inv(b)
@test norm(b*binv - I_t_5, Inf) ≤ 1e-11
@test norm(binv*b - I_t_5, Inf) ≤ 1e-11
@test norm(triu(b)*inv(triu(b)) - I_t_5, Inf) ≤ 1e-11
@test norm(inv(tril(b))*tril(b) - I_t_5, Inf) ≤ 1e-11
@test norm(b*binv - I, Inf) ≤ 1e-11
@test norm(binv*b - I, Inf) ≤ 1e-11
@test norm(triu(b)*inv(triu(b)) - I, Inf) ≤ 1e-11
@test norm(inv(tril(b))*tril(b) - I, Inf) ≤ 1e-11
end

@testset "Matrix multiplication for Taylor1" begin
Expand Down