Skip to content

Commit

Permalink
Upgrade to V0.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasvarga committed Mar 22, 2020
1 parent f54fbd2 commit 96b5684
Show file tree
Hide file tree
Showing 18 changed files with 2,769 additions and 565 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MatrixPencils"
uuid = "48965c70-4690-11ea-1f13-43a2532b2fa8"
authors = ["Andreas Varga <varga.andreas@gmail.com>"]
version = "0.3.0"
version = "0.4.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The current version of the package includes the following functions:

**Manipulation of structured linear matrix pencils of the form [A-λE B; C D]**

* **sreduceBF** Reduction to the basic condensed form [B A-λE; D C] with E upper triangular and nonsingular.
* **sklf** Computation of the Kronecker-like form exhibiting the full Kronecker structure
* **sklf_left** Computation of the Kronecker-like form exhibiting the left Kronecker structure
* **sklf_right** Computation of the Kronecker-like form exhibiting the right Kronecker structure
Expand All @@ -44,13 +45,19 @@ The current version of the package includes the following functions:

**Some applications to structured linear matrix pencils of the form [A-λE B; C D]**

* ***spkstruct** Determination of the complete Kronecker structure
* **spkstruct** Determination of the complete Kronecker structure
* **sprank** Determination of the normal rank
* **speigvals** Computation of the finite and infinite eigenvalues
* **spzeros** Computation of the finite and infinite (Smith) zeros

**Manipulation of linearizations of the form [A-λE B; C D] of polynomial or rational matrices**

* **lsminreal** Computation of least order strong liniarizations of rational matrices.
* **lsminreal2** Computation of least order strong liniarizations of rational matrices (potentially more efficient).
* **lsequal** Check the equivalence two linearizations.

A complete list of implemented functions is available [here](https://sites.google.com/site/andreasvargacontact/home/software/matrix-pencils-in-julia).

## Future plans

The collection of tools will be extended by adding new functionality, such as tools for the manipulation of regular pencils (e.g., reduction to a block-diagonal structure, eigenvalue assignment), manipulation of structured linear pencils arising from the linearization of polynomial and rational matrices (e.g., computation of strong linearizations), etc.
The collection of tools will be extended by adding new functionality, such as tools for the manipulation of regular pencils (e.g., reduction to a block-diagonal structure, eigenvalue assignment), building linearizations of polynomial matrices, applications of structured linear pencils manipulations to polynomial matrix problems, etc.
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ makedocs(
"sklftools.md",
"klfapps.md",
"sklfapps.md",
"pregular.md"
"pregular.md",
"lstools.md"
],
"Internal" => [
"klftools_int.md"
Expand Down
15 changes: 14 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The current version of the package includes the following functions:

| Function | Description |
| :--- | :--- |
| **sreduceBF** | Reduction to the basic condensed form [B A-λE; D C] with E upper triangular and nonsingular. |
| **sklf** | Computation of the Kronecker-like form exhibiting the full Kronecker structure |
| **sklf_left** | Computation of the Kronecker-like form exhibiting the left Kronecker structure |
| **sklf_right** | Computation of the Kronecker-like form exhibiting the right Kronecker structure |
Expand Down Expand Up @@ -68,14 +69,26 @@ The current version of the package includes the following functions:
| **speigvals** | Computation of the finite and infinite eigenvalues |
| **spzeros** | Computation of the finite and infinite (Smith) zeros |

**Manipulation of linearizations of the form [A-λE B; C D] of polynomial or rational matrices**

| Function | Description |
| :--- | :--- |
| **lsminreal** | Computation of least order strong liniarizations of rational matrices |
| **lsminreal2** | Computation of least order strong liniarizations of rational matrices (potentially more efficient)|
| **lsequal** | Check the equivalence two linearizations |

A complete list of implemented functions is available [here](https://sites.google.com/site/andreasvargacontact/home/software/matrix-pencils-in-julia).

## Future plans

The collection of tools will be extended by adding new functionality, such as tools for the manipulation of regular pencils (e.g., reduction to a block-diagonal structure, eigenvalue assignment), manipulation of structured linear pencils arising from the linearization of polynomial and rational matrices (e.g., computation of strong linearizations), etc.
The collection of tools will be extended by adding new functionality, such as tools for the manipulation of regular pencils (e.g., reduction to a block-diagonal structure, eigenvalue assignment), building linearizations of polynomial matrices, applications of structured linear pencils manipulations to polynomial matrix problems, etc.

## Release Notes

### Version 0.4.0

This release includes implementations of computational procedures to determine least order linerizations, as those which may arise from the linearization of polynomial and rational matrices. The elimination of simple eigenvalues is based on a new function to compute SVD-like forms of regular matrix pencils. A new function to check the equivalence of two linearizations is also provided.

### Version 0.3.0

This release includes implementations of several reductions of structured linear pencils to various KLFs and covers some straightforward applications such as the computation of finite and infinite eigenvalues and zeros, the determination of the normal rank, the determination of Kronecker indices and infinite eigenvalue structure.
Expand Down
2 changes: 2 additions & 0 deletions docs/src/klftools_int.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ MatrixPencils._preduce2!
MatrixPencils._preduce4!
MatrixPencils._sreduceB!
MatrixPencils._sreduceBA!
MatrixPencils._sreduceBAE!
MatrixPencils._sreduceC!
MatrixPencils._sreduceAC!
MatrixPencils._sreduceAEC!
```
11 changes: 11 additions & 0 deletions docs/src/lstools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Manipulation of linearizations of the form [A-λE B; C D] of polynomial or rational matrices

```@docs
lsequal
lsminreal
lsminreal2
sklf_right!
sklf_left!
sklf_rightfin!
sklf_leftfin!
```
2 changes: 1 addition & 1 deletion docs/src/makeindex.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Index

```@index
Pages = ["klftools.md", "klfapps.md", "sklftools.md", "sklfapps.md", "pregular","klftools_int.md" ]
Pages = ["klftools.md", "klfapps.md", "sklftools.md", "sklfapps.md", "pregular","lstools.md","klftools_int.md" ]
Module = ["MatrixPencils"]
Order = [:type, :function]
```
5 changes: 3 additions & 2 deletions docs/src/pregular.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
```@docs
isregular
fisplit
sklf_right!
sklf_left!
MatrixPencils.fisplit!
MatrixPencils._qrE!
MatrixPencils._svdlikeAE!
```
9 changes: 7 additions & 2 deletions src/MatrixPencils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ using .LapackUtil2: larfg!, larfgl!, larf!

export klf, klf_left, klf_right, klf_rlsplit
export prank, pkstruct, peigvals, pzeros, KRInfo
export isregular, fisplit
export sreduceBF, sklf, sklf_right, sklf_left, sklf_right!, sklf_left!
export isregular, fisplit, _svdlikeAE!
export sreduceBF, sklf, sklf_right, sklf_left, sklf_right!, sklf_left!, sklf_rightfin!, sklf_leftfin!
export sprank, spkstruct, speigvals, spzeros
export lsminreal, lsminreal2, lsequal
export lsbuild, lpbuild, lpbuildCF1, lpbuildCF2
export polbascoeffs, polbasparams, polbas2mon, polmon2bas, poldeg, polreverse
#export dss, ss, gnrank, gzero, gpole
#export LTISystem, AbstractDescriptorStateSpace
#export _preduceBF!, _preduce1!, _preduce2!, _preduce3!, _preduce4!
Expand All @@ -28,6 +31,8 @@ include("regtools.jl")
include("klfapps.jl")
include("sklftools.jl")
include("sklfapps.jl")
include("lstools.jl")
#include("poltools.jl")
#include("dstools.jl")
include("lputil.jl")
include("slputil.jl")
Expand Down
36 changes: 20 additions & 16 deletions src/lputil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ The rank decision based on the SVD-decomposition is generally more reliable, but
function _preduceBF!(M::AbstractMatrix{T1}, N::AbstractMatrix{T1},
Q::Union{AbstractMatrix{T1},Nothing}, Z::Union{AbstractMatrix{T1},Nothing},
L::Union{AbstractMatrix{T1},Missing} = missing, R::Union{AbstractMatrix{T1},Missing} = missing;
atol::Real = zero(eltype(M)), rtol::Real = (min(size(M)...)*eps(real(float(one(eltype(M))))))*iszero(atol),
fast = true, roff = 0, coff = 0, rtrail = 0, ctrail = 0,
withQ = true, withZ = true) where T1 <: BlasFloat
atol::Real = zero(real(T1)), rtol::Real = (min(size(M)...)*eps(real(float(one(T1)))))*iszero(atol),
fast::Bool = true, roff::Int = 0, coff::Int = 0, rtrail::Int = 0, ctrail::Int = 0,
withQ::Bool = true, withZ::Bool = true) where T1 <: BlasFloat
# In interest of performance, no dimensional checks are performed
mM, nM = size(M)
T = eltype(M)
Expand All @@ -64,7 +64,7 @@ function _preduceBF!(M::AbstractMatrix{T1}, N::AbstractMatrix{T1},
i12 = 1:roff+npp
j23 = coff+1:nM
jN23 = coff+npm+1:nM
eltype(M) <: Complex ? tran = 'C' : tran = 'T'
T <: Complex ? tran = 'C' : tran = 'T'
if fast
# compute in-place the QR-decomposition N22*P2 = Q2*[R2;0] with column pivoting
N22 = view(N,i22,j22)
Expand Down Expand Up @@ -109,7 +109,7 @@ function _preduceBF!(M::AbstractMatrix{T1}, N::AbstractMatrix{T1},
end
# R <- R*Z2*Pc2
ismissing(R) || (LinearAlgebra.LAPACK.ormrz!('R',tran,N22r,tau,view(R,:,j22)); R[:,j22] = R[:,jp])
N22[:,:] = [ zeros(n,m) triu(N22[i1,i1]); zeros(p,npm) ]
N22[:,:] = [ zeros(T,n,m) triu(N22[i1,i1]); zeros(T,p,npm) ]
else
# compute the complete orthogonal decomposition of N22 using the SVD-decomposition
U, S, Vt = LinearAlgebra.LAPACK.gesdd!('A',view(N,i22,j22))
Expand All @@ -128,9 +128,9 @@ function _preduceBF!(M::AbstractMatrix{T1}, N::AbstractMatrix{T1},
N[i11,j22] = N[i11,jp]
# N23 <- U'*N23
N[i22,jN23] = U'*N[i22,jN23]
# Q <- Q*SVD.U
# Q <- Q*U
withQ && (Q[:,i22] = Q[:,i22]*U)
# Z <- Q*SVD.V
# Z <- Q*V
if withZ
Z[:,j22] = Z[:,j22]*Vt'
Z[:,j22] = Z[:,jp]
Expand All @@ -139,7 +139,7 @@ function _preduceBF!(M::AbstractMatrix{T1}, N::AbstractMatrix{T1},
ismissing(L) || (L[i22,:] = U'*L[i22,:])
# R <- R*V
ismissing(R) || (R[:,j22] = R[:,j22]*Vt'; R[:,j22] = R[:,jp] )
N[i22,j22] = [ zeros(n,m) Diagonal(S[1:n]) ; zeros(p,npm) ]
N[i22,j22] = [ zeros(T,n,m) Diagonal(S[1:n]) ; zeros(T,p,npm) ]
end
return n, m, p
end
Expand Down Expand Up @@ -173,9 +173,10 @@ The performed orthogonal or unitary transformations are accumulated in `Q` (i.e.
The matrix `L` is overwritten by `Q1'*L` unless `L = missing` and the matrix `R` is overwritten by `R*Z1` unless `R = missing`.
"""
function _preduce1!(n::Int, m::Int, p::Int, M::AbstractMatrix{T1}, N::AbstractMatrix{T1},
Q::Union{AbstractMatrix{T1},Nothing}, Z::Union{AbstractMatrix{T1},Nothing}, tol,
Q::Union{AbstractMatrix{T1},Nothing}, Z::Union{AbstractMatrix{T1},Nothing}, tol::Real,
L::Union{AbstractMatrix{T1},Missing} = missing, R::Union{AbstractMatrix{T1},Missing} = missing;
fast = true, roff = 0, coff = 0, rtrail = 0, ctrail = 0, withQ = true, withZ = true) where T1 <: BlasFloat
fast::Bool = true, roff::Int = 0, coff::Int = 0, rtrail::Int = 0, ctrail::Int = 0,
withQ::Bool = true, withZ::Bool = true) where T1 <: BlasFloat
# Steps 1 and 2: QR- or SVD-decomposition based full column compression of [B; D] with the UT-form preservation of E
# Reduce the structured pencil
#
Expand Down Expand Up @@ -281,9 +282,10 @@ The performed orthogonal or unitary transformations are accumulated in `Q` (i.e.
The matrix `L` is overwritten by `Q1'*L` unless `L = missing` and the matrix `R` is overwritten by `R*Z1` unless `R = missing`.
"""
function _preduce2!(n::Int, m::Int, p::Int, M::AbstractMatrix{T1}, N::AbstractMatrix{T1},
Q::Union{AbstractMatrix{T1},Nothing}, Z::Union{AbstractMatrix{T1},Nothing}, tol,
Q::Union{AbstractMatrix{T1},Nothing}, Z::Union{AbstractMatrix{T1},Nothing}, tol::Real,
L::Union{AbstractMatrix{T1},Missing} = missing, R::Union{AbstractMatrix{T1},Missing} = missing;
fast = true, roff = 0, coff = 0, rtrail = 0, ctrail = 0, withQ = true, withZ = true) where T1 <: BlasFloat
fast::Bool = true, roff::Int = 0, coff::Int = 0, rtrail::Int = 0, ctrail::Int = 0,
withQ::Bool = true, withZ::Bool = true) where T1 <: BlasFloat
# Steps 1 and 2: QR- or SVD-decomposition based full column compression of [D C] with the UT-form preservation of E
# Reduce the structured pencil
#
Expand Down Expand Up @@ -403,9 +405,10 @@ The performed orthogonal or unitary transformations are accumulated in `Q` (i.e.
The matrix `L` is overwritten by `Q1'*L` unless `L = missing` and the matrix `R` is overwritten by `R*Z1` unless `R = missing`.
"""
function _preduce3!(n::Int, m::Int, M::AbstractMatrix{T1}, N::AbstractMatrix{T1},
Q::Union{AbstractMatrix{T1},Nothing}, Z::Union{AbstractMatrix{T1},Nothing}, tol,
Q::Union{AbstractMatrix{T1},Nothing}, Z::Union{AbstractMatrix{T1},Nothing}, tol::Real,
L::Union{AbstractMatrix{T1},Missing} = missing, R::Union{AbstractMatrix{T1},Missing} = missing;
fast = true, roff = 0, coff = 0, rtrail = 0, ctrail = 0, withQ = true, withZ = true) where T1 <: BlasFloat
fast::Bool = true, roff::Int = 0, coff::Int = 0, rtrail::Int = 0, ctrail::Int = 0,
withQ::Bool = true, withZ::Bool = true) where T1 <: BlasFloat
# Step 3: QR- or SVD-decomposition based full row compression of B and UT-form preservation of E
# Reduce the structured pencil
#
Expand Down Expand Up @@ -558,9 +561,10 @@ The performed orthogonal or unitary transformations are accumulated in `Q` (i.e.
The matrix `L` is overwritten by `Q1'*L` unless `L = missing` and the matrix `R` is overwritten by `R*Z1` unless `R = missing`.
"""
function _preduce4!(n::Int, m::Int, p::Int, M::AbstractMatrix{T1},N::AbstractMatrix{T1},
Q::Union{AbstractMatrix{T1},Nothing}, Z::Union{AbstractMatrix{T1},Nothing}, tol,
Q::Union{AbstractMatrix{T1},Nothing}, Z::Union{AbstractMatrix{T1},Nothing}, tol::Real,
L::Union{AbstractMatrix{T1},Missing} = missing, R::Union{AbstractMatrix{T1},Missing} = missing;
fast = true, roff = 0, coff = 0, rtrail = 0, ctrail = 0, withQ = true, withZ = true) where T1 <: BlasFloat
fast::Bool = true, roff::Int = 0, coff::Int = 0, rtrail::Int = 0, ctrail::Int = 0,
withQ::Bool = true, withZ::Bool = true) where T1 <: BlasFloat
# Step 4: QR- or SVD-decomposition based full column compression of C and UT-form preservation of E
# Reduce the structured pencil
#
Expand Down
Loading

0 comments on commit 96b5684

Please sign in to comment.