Skip to content

Commit

Permalink
Add tests for inv of Symmetric(Taylor1} matrices (#296)
Browse files Browse the repository at this point in the history
* Fix lu method

* Cleanup test

* Comment (ci.yml) continue-on-error for nightly

* Fix a problem introduced in mul!

* Revert signature of lu method

Works thanks to JuliaLang/julia#43700

* Add tests for inv of Symmetric{Taylor1{T}} matrices

* Bump patch version
  • Loading branch information
lbenet authored Jan 15, 2022
1 parent 427356d commit 55dffea
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ jobs:
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
# continue-on-error: ${{ matrix.julia-version == 'nightly' }}
- uses: julia-actions/julia-runtest@v1
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
# continue-on-error: ${{ matrix.julia-version == 'nightly' }}
- uses: julia-actions/julia-processcoverage@v1
- uses: coverallsapp/github-action@master
with:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TaylorSeries"
uuid = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
repo = "https://github.com/JuliaDiff/TaylorSeries.jl.git"
version = "0.11.4"
version = "0.11.5"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
2 changes: 1 addition & 1 deletion test/mixtures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using TaylorSeries

using Test
using LinearAlgebra, SparseArrays
using LinearAlgebra

@testset "Tests with mixtures of Taylor1 and TaylorN" begin
@test TaylorSeries.NumberNotSeries == Union{Real,Complex}
Expand Down
14 changes: 14 additions & 0 deletions test/onevariable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -613,25 +613,39 @@ end
ainv = inv(a)
b = Taylor1.(a, 5)
binv = inv(b)
c = Symmetric(b)
cinv = inv(c)
tol = 1.0e-11

for its = 1:10
a .= Diagonal(rand(2:12,3)) + rand(3, 3)
ainv .= inv(a)
b .= Taylor1.(a, 5)
binv .= inv(b)
c .= Symmetric(Taylor1.(a, 5))
cinv .= inv(c)
@test norm(binv - ainv, Inf) tol
@test norm(b*binv - I, Inf) tol
@test norm(binv*b - I, Inf) tol
@test norm(triu(b)*inv(UpperTriangular(b)) - I, Inf) tol
@test norm(inv(LowerTriangular(b))*tril(b) - I, Inf) tol
ainv .= inv(Symmetric(a))
@test norm(cinv - ainv, Inf) tol
@test norm(c*cinv - I, Inf) tol
@test norm(cinv*c - I, Inf) tol
@test norm(triu(c)*inv(UpperTriangular(c)) - I, Inf) tol
@test norm(inv(LowerTriangular(c))*tril(c) - I, Inf) tol

b .= b .+ t
binv .= inv(b)
@test norm(b*binv - I, Inf) tol
@test norm(binv*b - I, Inf) tol
@test norm(triu(b)*inv(triu(b)) - I, Inf) tol
@test norm(inv(tril(b))*tril(b) - I, Inf) tol
c .= Symmetric(b)
cinv .= inv(c)
@test norm(c*cinv - I, Inf) tol
@test norm(cinv*c - I, Inf) tol
end
end

Expand Down

2 comments on commit 55dffea

@lbenet
Copy link
Member Author

@lbenet lbenet commented on 55dffea Jan 15, 2022

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/52476

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.11.5 -m "<description of version>" 55dffea4f5eb9293bfcb1630fbd3167aec4d15d7
git push origin v0.11.5

Please sign in to comment.