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. Currently, the specific class is always Schur.

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

n <- 5L
(A <- Matrix(round(rnorm(n * n, sd = 100)), n, n))
(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(matrix(sch.A@x, n, n), only.values = TRUE)$values)
(e2 <- eigen(           A         , only.values = TRUE)$values)
(e3 <- sch.A@values)

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),
              `slot<-`(sch.A, "vectors", TRUE, double(0L)))
})

Matrix documentation built on Aug. 13, 2024, 3:01 p.m.