dgCMatrix-class {Matrix} | R Documentation

## Compressed, sparse, column-oriented numeric matrices

### Description

The `dgCMatrix` class is a class of sparse numeric matrices in the compressed, sparse, column-oriented format. In this implementation the non-zero elements in the columns are sorted into increasing row order. `dgCMatrix` is the “standard” class for sparse numeric matrices in the Matrix package.

### Objects from the Class

Objects can be created by calls of the form `new("dgCMatrix", ...)` or often more easily via `Matrix(*, sparse = TRUE)`.

### Slots

`x`:
  Object of class `"numeric"` - the non-zero elements of the matrix.
...
  all other slots are inherited from the superclass `"CsparseMatrix"`.

### Methods

coerce
  `signature(from = "matrix", to = "dgCMatrix")`
coerce
  `signature(from = "dgCMatrix", to = "matrix")`
coerce
  `signature(from = "dgCMatrix", to = "dgTMatrix")`
crossprod
  `signature(x = "dgCMatrix", y = "missing")` returns `t(x) %*% x` as an `dsCMatrix` object.
crossprod
  `signature(x = "dgCMatrix", y = "matrix")`: ...
crossprod
  `signature(x = "dgCMatrix", y = "numeric")`: ...
diag
  `signature(x = "dgCMatrix")`: returns the diagonal of `x`
dim
  `signature(x = "dgCMatrix")`: returns the dimensions of `x`
image
  `signature(x = "dgCMatrix")`: plots an image of `x` using the `levelplot` function
lu
  `signature(x = "dgCMatrix")`: computes the LU decomposition of a square `dgCMatrix` object

### See Also

Classes `dsCMatrix`, `dtCMatrix`, `lu`

### Examples

    (m <- Matrix(c(0,0,2:0), 3,5))
    str(m)
    m[,1]

[Package Matrix version 0.999375-33 Index]