tensorA (version 0.36.1)

pos.tensor: enumeration of index combinations

Description

This gives all combinations of indices of a tensor with dimension d in the order of the numbers in the memory.

Usage

pos.tensor(d)

Arguments

d

a dim attribute of a tensor

Value

a matrix with the same number of rows as the tensor has entries an the same number of columns as the tensor has dimensions. Each row represents the index combination of a the corresponding element.

Details

tensors are stored according to the R-convention that the leftmost index varies fastest.

See Also

reorder.tensor

Examples

Run this code
# NOT RUN {
   (A <- to.tensor(1:20,dim=c(A=2,B=2,C=5)))
   pos.tensor(dim(A))
# }

Run the code above in your browser using DataLab