Learn R Programming

fastmatrix (version 0.5-7721)

krylov: Computes a Krylov matrix

Description

Given \(\bold{A}\) an \(n\) by \(n\) real matrix and an \(n\)-vector \(\bold{b}\), this function constructs the Krylov matrix \(\bold{K}\), where $$\bold{K} = [\bold{b},\bold{Ab},\dots,\bold{A}^{m-1}\bold{b}].$$

Usage

krylov(a, b, m = ncol(a))

Value

Returns an \(n\) by \(m\) matrix.

Arguments

a

a numeric square matrix of order \(n\) by \(n\) for which the Krylov matrix is to be computed.

b

a numeric vector of length \(n\).

m

length of the Krylov sequence.

Examples

Run this code
a <- matrix(c(1, 3, 2, -5, 1, 7, 1, 5, -4), ncol = 3, byrow = TRUE)
b <- c(1, 1, 1)
k <- krylov(a, b, m = 4)
k

Run the code above in your browser using DataLab