postensor: enumeration of index combinations

pos.tensorR Documentation

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

Details

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

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.

Author(s)

K.Gerald van den Boogaart

See Also

reorder.tensor

Examples

   (A <- to.tensor(1:20,dim=c(A=2,B=2,C=5)))
   pos.tensor(dim(A))

tensorA documentation built on June 25, 2024, 1:16 a.m.

Related to postensor in tensorA...