Skip to contents

Symbolic element-wise modulo with offset function (ternary operation) for LazyTensor objects or any other mod function (if existing).

Usage

mod(x, ...)

Arguments

x

input for ifelse.default() or any other mod function (if existing).

...

optional additional input arguments.

Value

See value of mod.LazyTensor() or any other mod function (if existing).

Details

If x is a LazyTensor, see ifelse.LazyTensor(), else see the corresponding mod function (if existing) help page.

Warning: Do not confuse with Mod().

See also

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')

# call mod function
mod_x72 <- mod(x_i, 7, 2)

# works also with LazyTensors with same inner dimension or dimension 1
mod_xyz <- mod(x_i, y_j, z_i)
}