tridiag: Tridiagonal matrix

View source: R/functions.linalg.R

tridiagR Documentation

Tridiagonal matrix

Description

Constructs a tridiagonal matrix from three vectors supplied. The matrix size is adjusted according to the first vector (n). The function fails, if the other two dimensions are less than n-1. However, if the dimensions are larger, the function will truncate the vectors b and c.

Usage

tridiag(a, b, c = b)

Arguments

a

A vector of size n, whose entries will form a diagonal. No default value.

b

A vector of size n-1, whose entries will form a sub-diagonal. No default value.

c

A vector of size n-1, whose entries will form a super-diagonal. Defaults is c = b.

Examples

tridiag(c(1,2,3), c(4,5,6))
tridiag(c(1,2,3), c(4,5,6), c(7,8,9))

abylayzhumekenov/lanczos documentation built on April 27, 2022, 9:54 a.m.