Basic linear algebra operations for sparse matrices
of class matrix.csr.
Arguments
x
matrix of class matrix.csr.
y
matrix of class matrix.csr or a dense matrix or vector.
value
replacement values.
i,j
vectors of elements to extract or replace.
nrow
optional number of rows for the result.
lag
an integer indicating which lag to use.
differences
an integer indicating the order of the difference.
Details
Linear algebra operations for matrices of class
matrix.csr are designed to behave exactly as for
regular matrices. In particular, matrix multiplication, kronecker
product, addition,
subtraction and various logical operations should work as with the conventional
dense form of matrix storage, as does indexing, rbind, cbind, and diagonal
assignment and extraction. The method diag may be used to extract the
diagonal of a matrix.csr object, to create a sparse diagonal see
SparseM.ontology.
The function determinant computes the (log) determinant,
of the argument, returning a "det" object as the base function.
This is preferred over using the function det()
which is a simple wrapper for determinant().
Using det() in the following way is somewhat deprecated:
det() computes the determinant of the argument
matrix. If the matrix is of class matrix.csr then it must
be symmetric, or an error will be returned. If the matrix is of
class matrix.csr.chol then the determinant of the Cholesky
factor is returned, ie the product of the diagonal elements.
The function norm is used to check for symmetry by
computing the maximum of the elements of the difference between
the matrix and its transpose. Optionally, this sup norm can
be replaced by the Hilbert-Schmidt norm, or the l1 norm.