R: Triangular Dense Logical Matrices

ntrMatrix-class {Matrix} | R Documentation

## Triangular Dense Logical Matrices

### Description

The `"ntrMatrix"` class is the class of triangular, dense, logical matrices in nonpacked storage. The `"ntpMatrix"` class is the same except in packed storage.

### Slots

`x`:

  Object of class `"logical"`. The logical values that constitute the matrix, stored in column-major order.

`uplo`:

  Object of class `"character"`. Must be either "U", for upper triangular, and "L", for lower triangular.

`diag`:

  Object of class `"character"`. Must be either `"U"`, for unit triangular (diagonal is all ones), or `"N"`; see `triangularMatrix`.

`Dim`,`Dimnames`:

  The dimension (a length-2 `"integer"`) and corresponding names (or `NULL`), see the `Matrix` class.

`factors`:

  Object of class `"list"`. A named list of factorizations that have been computed for the matrix.

### Extends

`"ntrMatrix"` extends class `"ngeMatrix"`, directly, whereas
`"ntpMatrix"` extends class `"ndenseMatrix"`, directly.

Both extend Class `"triangularMatrix"`, directly, and class `"denseMatrix"`, `"lMatrix"` and others, indirectly, use `showClass("nsyMatrix")`, e.g., for details.

### Methods

Currently, mainly `t()` and coercion methods (for `as(.)`; use, e.g., `showMethods(class="nsyMatrix")` for details.

### See Also

Classes `ngeMatrix`, `Matrix`; function `t`

### Examples

    showClass("ntrMatrix")

    str(new("ntpMatrix"))
    (nutr <- as(upper.tri(matrix(,4,4)), "ntrMatrix"))
    str(nutp <- as(nutr, "ntpMatrix"))# packed matrix: only 10 = (4+1)*4/2 entries
    !nutp ## the logical negation (is *not* logical triangular !)
    ## but this one is:
    stopifnot(all.equal(nutp, as(!!nutp, "ntpMatrix")))

[Package Matrix version 1.0-6 Index]