Skip to content

Commit

Permalink
Update ci.yml (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty authored Aug 10, 2024
1 parent 81eee0d commit 304c2e5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
fail-fast: false
matrix:
version:
- 'lts'
- 'nightly'
- '1'
os:
Expand All @@ -37,7 +38,7 @@ jobs:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2.2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
Expand Down
8 changes: 8 additions & 0 deletions src/eigenGeneral.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ function LinearAlgebra.ldiv!(H::HessenbergMatrix, B::AbstractVecOrMat)
end
(\)(H::HessenbergMatrix, B::AbstractVecOrMat) = ldiv!(copy(H), copy(B))

if VERSION < v"1.10"
# ensure tests pass on Julia v1.6
copy_similar(A::AbstractArray, ::Type{T}) where {T} = copyto!(similar(A, T, size(A)), A)
eigtype(T) = promote_type(Float32, typeof(zero(T)/sqrt(abs2(one(T)))))
eigencopy_oftype(A, S) = copy_similar(A, S)
LinearAlgebra.eigvals(A::HessenbergMatrix{T}; kws...) where T = LinearAlgebra.eigvals!(eigencopy_oftype(A, eigtype(T)); kws...)
end

# Hessenberg factorization
struct HessenbergFactorization{T,S<:StridedMatrix,U} <: Factorization{T}
data::S
Expand Down
31 changes: 11 additions & 20 deletions test/eigenselfadjoint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,10 @@ using Test, GenericLinearAlgebra, LinearAlgebra, Quaternions

@testset "issue 123" begin
M = Hermitian([
big"-0.4080898675832881399369478084264191594976530854542904557798567397269356887436951";
big"-0.1032324294981949906363774065395184125237581835226155628209100984396171211818558";
big"-1.0795157507124452910839896877334667387210301781514938067860918240771876343947";
big"0.9172086645212876240254394768180975107502376572771647296150618931226550446699544";;
big"-0.1032324294981949906363774065395184125237581835226155628209100984396171211818558";
big"-0.9819956883377066621250198846550622559246996804965712336465013506629992739010227";
big"0.1882735697944729855991976669864503854920622386133987141371224931350749728226066";
big"-0.1599663084136352437739757607131301560774255778371317602542426234968564801904052";;
big"-1.0795157507124452910839896877334667387210301781514938067860918240771876343947";
big"0.1882735697944729855991976669864503854920622386133987141371224931350749728226066";
big"0.9688026817149176598146701814747478080649943014810992426739997593840858865727305";
big"-1.672789745967021000172452940954243617442140494364475046869527486458478435262502";;
big"0.9172086645212876240254394768180975107502376572771647296150618931226550446699544";
big"-0.1599663084136352437739757607131301560774255778371317602542426234968564801904052";
big"-1.672789745967021000172452940954243617442140494364475046869527486458478435262502";
big"0.4212828742060771422472975116067336073573584644697624467523583310058490760719874"
big"-0.4080898675832881399369478084264191594976530854542904557798567397269356887436951" big"-0.1032324294981949906363774065395184125237581835226155628209100984396171211818558" big"-1.0795157507124452910839896877334667387210301781514938067860918240771876343947" big"0.9172086645212876240254394768180975107502376572771647296150618931226550446699544";
big"-0.1032324294981949906363774065395184125237581835226155628209100984396171211818558" big"-0.9819956883377066621250198846550622559246996804965712336465013506629992739010227" big"0.1882735697944729855991976669864503854920622386133987141371224931350749728226066" big"-0.1599663084136352437739757607131301560774255778371317602542426234968564801904052";
big"-1.0795157507124452910839896877334667387210301781514938067860918240771876343947" big"0.1882735697944729855991976669864503854920622386133987141371224931350749728226066" big"0.9688026817149176598146701814747478080649943014810992426739997593840858865727305" big"-1.672789745967021000172452940954243617442140494364475046869527486458478435262502";
big"0.9172086645212876240254394768180975107502376572771647296150618931226550446699544" big"-0.1599663084136352437739757607131301560774255778371317602542426234968564801904052" big"-1.672789745967021000172452940954243617442140494364475046869527486458478435262502" big"0.4212828742060771422472975116067336073573584644697624467523583310058490760719874"
])
F = eigen(M)
@test M * F.vectors F.vectors * Diagonal(F.values)
Expand All @@ -160,9 +148,12 @@ using Test, GenericLinearAlgebra, LinearAlgebra, Quaternions
@testset "#133" begin
A = SymTridiagonal{BigFloat}(randn(5), randn(4))
T = Tridiagonal(A)
@test eigvals(A) == eigvals(T) == eigvals(A; sortby=LinearAlgebra.eigsortby) == eigvals(T; sortby=LinearAlgebra.eigsortby) == eigvals!(deepcopy(A); sortby=LinearAlgebra.eigsortby)
@test eigen(A).values == eigen(T).values == eigen(A; sortby=LinearAlgebra.eigsortby).values == eigen(T; sortby=LinearAlgebra.eigsortby).values
# compare abs to avoid sign issues
@test abs.(eigen(A).vectors) == abs.(eigen(T).vectors) == abs.(eigen(A; sortby=LinearAlgebra.eigsortby).vectors) == abs.(eigen(T; sortby=LinearAlgebra.eigsortby).vectors)
if VERSION v"1.10"
# The following depends on more recent behaviour of eigvals/eigen in stdlib
@test eigvals(A) == eigvals(T) == eigvals(A; sortby=LinearAlgebra.eigsortby) == eigvals(T; sortby=LinearAlgebra.eigsortby) == eigvals!(deepcopy(A); sortby=LinearAlgebra.eigsortby)
@test eigen(A).values == eigen(T).values == eigen(A; sortby=LinearAlgebra.eigsortby).values == eigen(T; sortby=LinearAlgebra.eigsortby).values
# compare abs to avoid sign issues
@test abs.(eigen(A).vectors) == abs.(eigen(T).vectors) == abs.(eigen(A; sortby=LinearAlgebra.eigsortby).vectors) == abs.(eigen(T; sortby=LinearAlgebra.eigsortby).vectors)
end
end
end

2 comments on commit 304c2e5

@andreasnoack
Copy link
Member

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/112827

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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.3.12 -m "<description of version>" 304c2e5acb84a3405dfdf5ac5e5776f193dd3809
git push origin v0.3.12

Please sign in to comment.