Skip to content

Commit 892043b

Browse files
add readme example and bump version
1 parent 4d31edd commit 892043b

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "MatrixFactorizations"
22
uuid = "a3b82374-2e81-5b9e-98ce-41277c0e4c87"
3-
version = "3.1.2"
3+
version = "3.1.3"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

README.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ MatrixFactorizations.QL{Float64,Array{Float64,2}}
2323
Q factor:
2424
5×5 MatrixFactorizations.QLPackedQ{Float64,Array{Float64,2}}:
2525
0.155574 -0.112555 -0.686362 -0.701064 0.0233276
26-
0.363037 -0.0583277 -0.0329428 0.152682 0.916736
27-
-0.670742 0.294355 -0.547867 0.347157 0.206843
28-
-0.61094 -0.566041 0.324432 -0.353128 0.276396
29-
0.144425 -0.759527 -0.349868 0.489877 -0.199681
26+
0.363037 -0.0583277 -0.0329428 0.152682 0.916736
27+
-0.670742 0.294355 -0.547867 0.347157 0.206843
28+
-0.61094 -0.566041 0.324432 -0.353128 0.276396
29+
0.144425 -0.759527 -0.349868 0.489877 -0.199681
3030
L factor:
3131
5×5 Array{Float64,2}:
3232
-1.75734 0.0 0.0 0.0 0.0
@@ -38,3 +38,35 @@ L factor:
3838
julia> b = randn(5); ql(A) \ b A \ b
3939
true
4040
```
41+
42+
## Jordan canonical form
43+
44+
Every square matrix has a Jordan canonical form. Although Jordan blocks are unstable
45+
with respect to perturbations, the Jordan canonical form of a rational matrix with
46+
rational eigenvalues can be found exactly:
47+
```julia
48+
49+
julia> A = [0 0 1 7 -1; -5 -6 -6 -35 5; 1 1 -7 7 -1; 0 0 0 -9 0; 2 1 -5 -42 -3];
50+
51+
julia> λ = [-9, -7, -7, -1, -1//1];
52+
53+
julia> V, J = jordan(A, λ)
54+
Jordan{Rational{Int64}, Matrix{Rational{Int64}}, Matrix{Rational{Int64}}}
55+
Generalized eigenvectors:
56+
5×5 Matrix{Rational{Int64}}:
57+
0 0 0 1 0
58+
0 1 0 0 -1
59+
0 1 -1 0 0
60+
1 0 0 0 0
61+
7 1 -1 1 -1
62+
Jordan normal form:
63+
5×5 Matrix{Rational{Int64}}:
64+
-9 0 0 0 0
65+
0 -7 1 0 0
66+
0 0 -7 0 0
67+
0 0 0 -1 1
68+
0 0 0 0 -1
69+
70+
julia> A == V*J/V
71+
true
72+
```

0 commit comments

Comments
 (0)