Usage
Diagonal(n, x = NULL)
.symDiagonal(n, x = rep.int(1,n), uplo = "U")
.sparseDiagonal(n, x = 1, uplo = "U", shape = if(missing(cols)) "t" else "g",
unitri, kind, cols = if(n) 0:(n - 1L) else integer(0))
Arguments
n
integer specifying the dimension of the (square) matrix. If
missing, length(x) is used.
x
numeric or logical; if missing, a unit diagonal
$n x n$ matrix is created.
uplo
for .symDiagonal, the resulting sparse
symmetricMatrix will have slot uplo set
from this argument, either "U" or "L". Only rarely
will it make sense to change this from the default.
shape
string of 1 character, one of c("t","s","g"), to
choose a triangular, symmetric or general result matrix.
unitri
optional logical indicating if a triangular result
should be unit-triangular, i.e., with diag = "U"
slot, if possible. The default, missing, is the same
as TRUE. kind
string of 1 character, one of c("d","l","n"), to
choose the storage mode of the result, from classes
dsparseMatrix,
lsparseMatrix, or
nsparseMatrix, respectively.
cols
integer vector with values from 0:(n-1), denoting
the columns to subselect conceptually, i.e., get the
equivalent of Diagonal(n,*)[, cols + 1].