Skip to contents

Symbolically applies opstr operation to x, y and z.

Usage

ternaryop.LazyTensor(x, y, z, opstr, dim_check_type = "sameor1", dim_res = NA)

Arguments

x

A LazyTensor, a ComplexLazyTensor, a vector of numeric values, or a scalar value.

y

A LazyTensor, a ComplexLazyTensor, a vector of numeric values, or a scalar value.

z

A LazyTensor, a ComplexLazyTensorr, a vector of numeric values, or a scalar value.

opstr

A text string corresponding to an operation.

dim_check_type

A string to specify if, and how, we should check input dimensions. Supported values are:

  • "same": x and y should have the same inner dimension; -"sameor1" (default): x and y should have the same inner dimension or at least one of them should be of dimension 1;

  • NA: no dimension restriction.

dim_res

NA (default) or an integer corresponding to the inner dimension of the output LazyTensor. If NA, dim_res is set to the maximum between the inner dimensions of the three input LazyTensors.

Value

An object of class "LazyTensor".

Author

Chloe Serre-Combe, Amelie Vernay

Examples

if (FALSE) {
# basic example
D <- 3
M <- 100
N <- 150
P <- 200
x <- matrix(runif(M * D), M, D)
y <- matrix(runif(N * D), N, D)
z <- matrix(runif(P * D), P, D)
x_i <- LazyTensor(x, index = 'i')
y_j <- LazyTensor(y, index = 'j')
z_i <- LazyTensor(z, index = 'i')

# symbolic matrix:
tern_xyz <- ternaryop.LazyTensor(x_i, y_j, z_i, "IfElse")
}