Skip to content

Commit

Permalink
Load ApproxFun in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasvarga committed Oct 24, 2024
1 parent c8662d0 commit 5941921
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ApproxFun = "28f2ccd6-bb30-5033-b560-165f7b14dc2f"
FourierApproxExt = "ApproxFun"

[extras]
ApproxFun = "28f2ccd6-bb30-5033-b560-165f7b14dc2f"
Bessels = "0e736298-9ec6-45e8-9647-e4fc86a2fe38"
MatrixPencils = "48965c70-4690-11ea-1f13-43a2532b2fa8"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand All @@ -46,4 +47,4 @@ julia = "1.10"


[targets]
test = ["Bessels","MatrixPencils","Test"]
test = ["ApproxFun","Bessels","MatrixPencils","Test"]
2 changes: 2 additions & 0 deletions src/psfutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,7 @@ function psordschur!(S::AbstractVector{Matrix{Float64}}, Z::AbstractVector{Matri
rev || (reverse!(m); reverse!(n))
ldq = rev ? n : [m[end];m[1:end-1]]
nc = minimum(n)
nc == length(select) || throw(ArgumentError("Dimension of select must be equal to the number of core eigenvalues $nc"))
kschur = rev ? schurindex : k-schurindex+1
ni = zeros(Int,k)
s = ones(Int,k)
Expand Down Expand Up @@ -1195,6 +1196,7 @@ function psordschur1!(S::AbstractVector{Matrix{Float64}}, Z::AbstractVector{Matr
(all(m .== nc) && all(n .== nc)) || error("all elements of S must be square matrices of same dimension")
k == length(Z) || error("S and Z must have the same length")
(all(size.(Z,1) .== nc) && all(size.(Z,2) .== nc)) || error("all elements of Z must be square matrices of same dimension as S")
nc == length(select) || throw(ArgumentError("Dimension of select must be equal to the number of core eigenvalues $nc"))
kschur = rev ? schurindex : k-schurindex+1
ni = zeros(Int,k)
s = ones(Int,k)
Expand Down
2 changes: 1 addition & 1 deletion test/test_pmutils.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Test_pmutils

using PeriodicMatrices
using ApproxFun
using Symbolics
using PeriodicMatrices
using Test
using LinearAlgebra
using MatrixPencils
Expand Down
7 changes: 4 additions & 3 deletions test/test_pschur.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Test_pschur

using PeriodicMatrices
using ApproxFun
using Test
using LinearAlgebra
using LinearAlgebra: BlasInt
Expand Down Expand Up @@ -452,17 +453,17 @@ A3 = [-4 3 5 2 2; 2 -5 -2 0 2; -1 -2 5 3 0; 0 1 -3 -5 0; 0 0 4 -4 3];

A = [A1, A2, A3];
@time S, Z, eigs, ischur, α, γ = pschur(A; rev = true);
select = (real(eigs) .< 0)[1:3]
select = (real(eigs) .< 0)
@time psordschur!(S,Z,select; schurindex=ischur, rev = true)
@test check_psim(A,Z,S; rev = true)
ev=MatrixPencils.ordeigvals(S[3]*S[2]*S[1])

@time S, Z, eigs, ischur, α, γ = pschur(A; rev = true);
select = (real(eigs) .< 0)[1:3]
select = (real(eigs) .< 0)
@time psordschur1!(S,Z,select; schurindex=ischur, rev = true)
@test check_psim(A,Z,S; rev = true)
ev1=MatrixPencils.ordeigvals(S[3]*S[2]*S[1])
@test ev ev1
@test sort(ev) sort(ev1)


# Example Hench & Laub IEETAC 1994
Expand Down

0 comments on commit 5941921

Please sign in to comment.