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

dgcMatrix sparse diagonal


tXiao95/gallery documentation built on Aug. 30, 2024, 6:14 a.m.