ttt {TRES} | R Documentation |
Matrix product of two tensors
Description
Matrix product of two tensors unfolded on the specified modes.
Usage
ttt(x, y, ms)
Arguments
x |
A tensor instance. |
y |
A tensor instance. |
ms |
The indices of the modes to compute on. A single value or a vector. |
Details
Suppose x
is a -way tensor with dimension
and
y
is a t-way tensor with dimension .
ms
specifies the indices on which the tensors x
and y
are unfolded as columns. Thus, ms
must be a subset of 1:min{s,t}
. Meanwhile, the sizes of the dimensions specified by ms
must match, e.g., if ms = 1:k
where k <= min{s,t}
, then . Let
and
denote the unfolded matrices, the matrix
is returned. See Examples for a better illustration.
Value
Return the matrix product of tensors x
and y
.
Examples
x <- rTensor::as.tensor(array(runif(24), c(3, 4, 2)))
y <- rTensor::as.tensor(array(runif(24), c(3, 4, 2)))
z <- ttt(x, y, 1:2)
[Package TRES version 1.1.5 Index]