Returns the lower and upper bandwidth of a sparse matrix

bandwidth(A)

Arguments

A

spam object

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.

Value

Integer vector containing the lower and upper bandwidth

See also

Author

Reinhard Furrer

Examples

bandwidth(spam(c(0, 1), 3, 2))
#> [1] 1 1

bandwidth(spam(c(0, 0, 1, rep(0, 9)), 4, 3))
#> [1]  2 -2