Skip to content

Update ci.yml #135

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

Merged
merged 8 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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 @@
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...)

Check warning on line 37 in src/eigenGeneral.jl

View check run for this annotation

Codecov / codecov/patch

src/eigenGeneral.jl#L34-L37

Added lines #L34 - L37 were not covered by tests
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