MatrixList-class: List of Matrix objects

Description Extends Methods Examples

Description

A list of Matrix objects, which must all have the same dimensions.

Extends

list

Directly.

Methods

Many of these methods simply apply a function elementwise to each matrix in the object, and work for both "MatrixList" objects and "Matrix" objects.

%bd%

signature(e1 = "MatrixList", e2 = "Matrix"): Block diagonal of e1 and e2.

%bd%

signature(e1 = "MatrixList", e2 = "MatrixList"): Block diagonal of e1 and e2.

%bd%

signature(e1 = "Matrix", e2 = "MatrixList"): Block diagonal of e1 and e2.

cbind2

signature(x = "MatrixList", y = "Matrix"): Bind columns of e1 and e2.

cbind2

signature(x = "MatrixList", y = "MatrixList"): Bind columns of e1 and e2.

cbind2

signature(x = "Matrix", y = "MatrixList"): Bind columns of e1 and e2.

dim

signature(x = "MatrixList") : Dimensions of the matrix elements in the object. Use length to the get the number of matrices.

Ops

signature(e1 = "MatrixList", e2 = "Matrix"): Operators. These are applied elementwise to e1 and e2.

Ops

signature(e1 = "MatrixList", e2 = "MatrixList"): Operators. These are applied elementwise to e1 and e2.

Ops

signature(e1 = "Matrix", e2 = "MatrixList"): Operators. These are applied elementwise to e1 and e2.

rbind2

signature(x = "MatrixList", y = "Matrix"): Bind rows of e1 and e2.

rbind2

signature(x = "MatrixList", y = "MatrixList"): Bind rows of e1 and e2.

rbind2

signature(x = "Matrix", y = "MatrixList"): Bind rows of e1 and e2.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library("Matrix")
# create a Matrix List of three 2 x 2 matrices
foo <- MatrixList(Matrix(1, 2, 2), Matrix(2, 2, 2), Matrix(3, 2, 2))

# create another list
bar <- MatrixList(replicate(length(foo), Matrix(5, 2, 2)))
# Some methods (defined for both MatrixList objects, and
# MatrixList, Matrix object combinations
foo - bar
foo + bar
foo[[1]] + bar
cBind(foo, bar)
rBind(foo, bar)
# block diagonal

jrnold/yakf documentation built on May 20, 2019, 2:06 a.m.