Learn R Programming

spam (version 1.4-0)

bandwidth: Bandwidth of a Sparse Matrix

Description

Returns the lower and upper bandwidth of a sparse matrix

Usage

bandwidth(A)

Arguments

A

spam object

Value

Integer vector containing the lower and upper bandwidth

Details

The matrix does not need to be diagonal. Values can be negative indicating the the matrix contains a band cinfined in the upper or lower triangular part.

See Also

diag.spam.

Examples

Run this code
bandwidth(spam(c(0, 1), 3, 2))

bandwidth(spam(c(0, 0, 1, rep(0, 9)), 4, 3))

Run the code above in your browser using DataLab