Schur-methods: Methods for Schur Factorization

Schur-methodsR Documentation

Methods for Schur Factorization

Description

Computes the Schur factorization of an n \times n real matrix A, which has the general form

A = Q T Q'

where Q is an orthogonal matrix and T is a block upper triangular matrix with 1 \times 1 and 2 \times 2 diagonal blocks specifying the real and complex conjugate eigenvalues of A. The column vectors of Q are the Schur vectors of A, and T is the Schur form of A.

Methods are built on LAPACK routine dgees.

Usage

Schur(x, vectors = TRUE, ...)

Arguments

x

a finite square matrix or Matrix to be factorized.

vectors

a logical. If TRUE (the default), then Schur vectors are computed in addition to the Schur form.

...

further arguments passed to or from methods.

Value

An object representing the factorization, inheriting from virtual class SchurFactorization if vectors = TRUE. Currently, the specific class is always Schur in that case. An exception is if x is a traditional matrix, in which case the result is a named list containing Q, T, and EValues slots of the Schur object.

If vectors = FALSE, then the result is the same named list but without Q.

References

The LAPACK source code, including documentation; see https://netlib.org/lapack/double/dgees.f.

Golub, G. H., & Van Loan, C. F. (2013). Matrix computations (4th ed.). Johns Hopkins University Press. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.56021/9781421407944")}

See Also

Class Schur and its methods.

Class dgeMatrix.

Generic functions expand1 and expand2, for constructing matrix factors from the result.

Generic functions Cholesky, BunchKaufman, lu, and qr, for computing other factorizations.

Examples


showMethods("Schur", inherited = FALSE)
set.seed(0)

Schur(Hilbert(9L)) # real eigenvalues

(A <- Matrix(round(rnorm(25L, sd = 100)), 5L, 5L))
(sch.A <- Schur(A)) # complex eigenvalues

## A ~ Q T Q' in floating point
str(e.sch.A <- expand2(sch.A), max.level = 2L)
stopifnot(all.equal(A, Reduce(`%*%`, e.sch.A)))

(e1 <- eigen(sch.A@T, only.values = TRUE)$values)
(e2 <- eigen(    A  , only.values = TRUE)$values)
(e3 <- sch.A@EValues)

stopifnot(exprs = {
    all.equal(e1, e2, tolerance = 1e-13)
    all.equal(e1, e3[order(Mod(e3), decreasing = TRUE)], tolerance = 1e-13) 
    identical(Schur(A, vectors = FALSE),
              list(T = sch.A@T, EValues = e3))    
    identical(Schur(as(A, "matrix")),
              list(Q = as(sch.A@Q, "matrix"),
                   T = as(sch.A@T, "matrix"), EValues = e3))
})

Matrix documentation built on Oct. 19, 2024, 1:08 a.m.