R/matrices.R
Matrix.to.Pointers.Rd
Returns a list of row indices, column indices, pointers, and/or values of a sparse Hessian.
Matrix.to.Pointers(
M,
as.symmetric = Matrix::isSymmetric(M),
values = !is(M, "nMatrix"),
order = NULL,
index1 = TRUE
)
A sparse Matrix, as defined in the Matrix package.
Defaults to isSymmetric(M). If M is symmetric, and as.symmetric is FALSE, then index/pointer elements in the output list will be labeled according to order. If M is not symmetric, and as.symmetric is TRUE, then an error will be triggered.
If TRUE, values are returned in list as 'x'. Defaults to TRUE for numeric and logical matrices, and FALSE for pattern matrices. If M is a pattern matrix, values=TRUE will trigger a warning.
Determines the indexing/compression scheme for the output matrix. Use 'triplet" to get row and column indices. Defaults to the same class as M.
TRUE (default) if return indices and pointers should use 1-based indexing. FALSE for 0-based indexing.
A list with the following elements. If order=='row',
Integer vector containing column indices of non-zero elements
Integer vector containing pointers to elements of jCol at which the next row begins.
If order=='column'
Integer vector containing row indices of non-zero elements
Integer vector containing pointers to elements of iRow at which the next column begins.
If order=='triplet'
Row indices of non-zero elements
Column indices of non-zero elements
If as.symmetric is TRUE, then the row/column orientation does not matter.
Integer vector containing indices of non-zero elements
Integer vector containing pointers to elements of idx at which the next row or column begins.
If values=TRUE, the return list includes x, the values of the non-zero elements. The 'class' element is the name of the sparse matrix class to which the output corresponds (identifies numeric type, pattern, and indexing/compression scheme).
This function is included primarily for debugging purposes. It is used internally, but would not ordinarily be called by an end user.
Matrix.to.Coord