Object Arrays and Main Subclasses
One, two and higher-dimensional object arrays, along with their main subclasses.
ObjectArray (CLASS="<OBJECT>", n, ..., names, default.value=NULL) NestMatrix (nr, nc, ..., rnames, cnames, conform=TRUE, recursive=FALSE, default.value=ZERO) MatrixArray (n, ..., conform=TRUE, default.value=ZERO) as.ObjectArray (x, CLASS="<OBJECT>", n, ..., names) as.NestMatrix (x, ..., rnames, cnames, conform=TRUE, recursive=FALSE)
CLASS |
A character vector of classes. |
n |
Integer, the dimensions. |
nr, nc |
Integers, the dimensions, same as n, where n is of length two. |
names |
List of character vectors, of names in each dimension, which should match n, above. |
rnames, cnames |
Character vectors of nr row names and nc column names. |
conform |
Logical, if true, submatrices are required to have conformable dimensions. |
recursive |
Logical, if true, sub elements can be nested matrices. |
default.value |
Default value, for each element. |
x |
In as.ObjectArray, a list. |
... |
Ignored. |
ObjectArray(s) are similar to list matrices and list arrays.
(But these are S4 classes, with a number of differences).
Setting individual elements to NULL, doesn't remove them.
And they support formatting, via objtag methods.
By default, and ObjectArray can contain any objects, however, this can be restricted by the CLASS argument.
A NestMatrix is a subclass of an ObjectArray that contains ZERO or standard matrices.
If recursive is true, then it may also contain other NestMatrix objects.
Note that NestMatrix elements can have a scalar value assigned, but it will be converted to a 1x1 matrix.
A MatrixArray is also a subclass of an ObjectArray, with contains standard matrices.
And is designed for matrix array multiplication.
ZERO is an instance of the class ZERO.
This is a generalization of zero matrices.
Which can be used in NestMatrix objects, without being constrained by conformable dimensions.
Note, do not to access slots directly.
(But rather use functions within this package).
All functions return objects of their classes.
VMap
Another subclass of ObjectArray.
PartMatrix
Similar to NestMatrix.
SectMatrix
A generalization of PartMatrix
Binary Operators
Operations on MatrixArray objects.
v <- ObjectArray ("list", c (2, 2) ) v [[1, 1]] <- list (1) v [[2, 1]] <- list (1, 2) v [[1, 2]] <- list (1, 2, 3) v [[2, 2]] <- list (1, 2, 3, 4) v v [[1, 2]] nm1 <- NestMatrix (4, 4) nm1 msub <- NestMatrix (4, 4) nm2 <- NestMatrix (4, 4, recursive=TRUE, default.value=msub) nm2 nm3 <- as.NestMatrix (PartMatrix (5, 5, 2:4, 2:4) ) nm3
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.