spdiags: Create sparse diagonal matrix

View source: R/spdiags.R

spdiagsR Documentation

Create sparse diagonal matrix

Description

Creates a sparse representation of multiple diagonal matrix

Usage

spdiags(A, d, m, n)

Arguments

A

matrix where columns correspond to the desired diagonals

d

indices of the diagonals to be filled in. 0 is main diagonal. -1 is first subdiagonal and +1 is first superdiagonal.

m

row dim

n

col dim

Value

sparse diagonal matrix of class 'dgcMatrix'


gallery documentation built on Sept. 26, 2024, 5:07 p.m.