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 s-way tensor with dimension p_1 \times \ldots \times p_s and y is a t-way tensor with dimension r_1 \times \ldots \times r_t. 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 p_1\times \ldots p_k = s_1\times \ldots s_k. Let X_0 and Y_0 denote the unfolded matrices, the matrix X_0 \times Y_0^T 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]