Learn R Programming

rkeops (version 2.2.2)

mod: Element-wise modulo with offset function

Description

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

Usage

mod(x, ...)

Value

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

Arguments

x

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

...

optional additional input arguments.

Author

Chloe Serre-Combe, Amelie Vernay

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

mod.LazyTensor()

Examples

Run this code
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)
}

Run the code above in your browser using DataLab