Learn R Programming

vectools (version 0.3.0)

26_MatrixArray: Matrix Arrays

Description

A MatrixArray is a subclass of ObjectArray. These represent a (currently one dimensional) array of matrices.

The package provides binary operators to apply matrix multiplication over the entire array.

NOTE: INTERNAL STRUCTURE OF OBJECTS IS SUBJECT TO CHANGE. DO NOT USE SLOTS, DIRECTLY.

Usage

MatrixArray (n, …, NR, NC, conform=TRUE, default.value=ZERO)
as.MatrixArray (v, …, n, NR, NC, conform=TRUE)

Arguments

n

Integer, the length Currently, the top-level object is constrained to one dimension.

v

A suitable object. Such as a list of matrices.

NR, NC

Currently, these need to be set to NA.

conform

Logical, if true, submatrices are required to have conformable dimensions.

default.value

The default value.

Ignored.

Value

A MatrixArray object.

See Also

ObjectArray

NestMatrix, GeomArray

Binary Operators

Examples

Run this code
# NOT RUN {
v <- MatrixArray (2, NR=NA, NC=NA)
v [[1]] <- matrix (1:4, 2, 2)
v [[2]] <- matrix (5:8, 2, 2)
v

t <- diag (c (2, 2) )
u <- t 
# }
# NOT RUN {
<!-- %*% v -->
# }
# NOT RUN {
u
u [[1]]
u [[2]]
# }

Run the code above in your browser using DataLab