@@ -119,7 +119,6 @@ using LinearAlgebra, MatrixFactorizations, Random, Test
119119 @testset " https://en.wikipedia.org/wiki/Jordan_normal_form" begin
120120 A = [5 4 2 1 ; 0 1 - 1 - 1 ; - 1 - 1 3 0 ; 1 1 - 1 2 // 1 ]
121121 λ = [1 , 2 , 4 , 4 // 1 ]
122- @test λ ≈ eigvals (A)
123122 V, J = jordan (A, λ)
124123 @test A* V == V* J
125124 # Next step in this code would be to completely elucidate the block structure in J:
@@ -129,14 +128,12 @@ using LinearAlgebra, MatrixFactorizations, Random, Test
129128 @testset " https://math.stackexchange.com/questions/1221465/jordan-canonical-form-deployment" begin
130129 A = [- 3 1 0 1 1 ; - 3 1 0 1 1 ; - 4 1 0 2 1 ; - 3 1 0 1 1 ; - 4 1 0 1 2 // 1 ]
131130 λ = [0 , 0 , 0 , 0 , 1 // 1 ]
132- @test λ ≈ eigvals (A)
133131 V, J = jordan (A, λ)
134132 @test A* V == V* J
135133 end
136134 @testset " https://math.stackexchange.com/questions/3627150/find-the-jordan-form" begin
137135 A = [- 83 - 15 - 68 - 2 - 100 216 ; - 3 1 - 2 0 - 4 9 ; 42 7 35 1 50 - 108 ; 43 8 35 3 50 - 108 ; 22 4 18 1 27 - 54 ; - 10 - 2 - 8 0 - 12 28 // 1 ]
138136 λ = [1 , 2 , 2 , 2 , 2 , 2 // 1 ]
139- @test all (det (A- λ[j]* I) == 0 for j in 1 : length (λ))
140137 V, J = jordan (A, λ)
141138 @test A* V == V* J
142139 end
@@ -191,18 +188,16 @@ using LinearAlgebra, MatrixFactorizations, Random, Test
191188 @testset " https://www.numerade.com/ask/question/1-find-a-jordan-canonical-form-of-the-following-matrix-4-1-0-0-a-h4ih-1-28093/" begin
192189 A = [4 1 0 0 0 ; - 1 3 1 0 0 ; 1 0 2 0 0 ; - 2 - 1 - 1 2 1 ; 1 0 0 0 2 // 1 ]
193190 λ = [2 , 2 , 3 , 3 , 3 // 1 ]
194- @test all (det (A- λ[j]* I) == 0 for j in 1 : length (λ))
195191 V, J = jordan (A, λ)
196192 @test A* V == V* J
197193 end
198194 @testset " https://www.chegg.com/homework-help/questions-and-answers/3-find-jordan-canonical-form-j-following-matrices-determine-matrix-x-xax-j-11-0-1-1-2-0-0--q25805340" begin
199195 A = [1 0 1 ; 1 0 2 ; 1 - 1 2 ]
200196 λ = [1 , 1 , 1 ]
201- @test all (det (A- λ[j]* I) == 0 for j in 1 : length (λ))
202197 V, J = jordan (A, λ)
203198 @test A* V == V* J
204199 A = [0 0 0 1 ; 0 0 0 1 ; 1 2 0 0 ; 0 0 0 - 1.0 ]
205- V, J = jordan (A, eigvals (A) )
200+ V, J = jordan (A)
206201 @test A* V ≈ V* J
207202 A = [1 2 0 0 ; 0 1 2 0 ; 0 0 1 2 ; 0 0 0 1 // 1 ]
208203 λ = diag (A) # because A is upper triangular
0 commit comments