R/matrices.R
Coord.to.Pointers.Rd
Returns indices and pointers that define a sparse Hessian in compressed format. Inputs are the row and column indices.
Coord.to.Pointers(
rows,
cols,
dims,
triangle = TRUE,
lower = TRUE,
symmetric = FALSE,
order = c("column", "row", "triplet"),
index1 = TRUE
)
row and column indices of non-zero elements
2-element vector for number of rows and columns.
Is input intended to be a triangular (TRUE) or full
(FALSE) matrix. See details for how this argument is interpreted
for different values of order
.
If triangular
is true, this argument identifies
the input matrix as lower- or upper-triangular. This argument is
ignored if triangle
is FALSE.
If TRUE, and matrix is triangular, then the matrix will be treated as symmetric, with only the triangular elements provided. If matrix is neither triangular nor symmetric, then symmetric=TRUE will probably trigger an error.
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 if using 1-based indexing. FALSE for 0-based indexing.
A list. See Matrix.to.Pointers (no values are included in return list).
triangle
and order
have the following interpretation:
Input rows
and cols represent lower
or upper triangle of a matrix. If order="symmetric"
, then
the output list will be for a full, symmetric matrix. Otherwise,
the output list will be for only the lower or upper triangle. Any
elements outside of the specified triangle will trigger an error.
Input rows
and cols represent a full
matrix. If that matrix is not symmetric, then
order=="symmetric"
will trigger an error.
Matrix.to.Pointers