Skip to contents

Maximum operation or maximum reduction for LazyTensor objects.

Usage

# S3 method for LazyTensor
max(x, index = NA, ...)

max_reduction(x, index)

Arguments

x

a LazyTensor or a ComplexLazyTensor.

index

a character corresponding to the wanted reduction dimension, either "i" or "j", to specify whether if the max reduction is done along the index i or j. It can be NA (default) when no reduction is desired.

...

not used, only present for method compatibility with the corresponding generic function.

Value

a LazyTensor if index = NA or an array storing the result of the specified max reduction otherwise.

Details

If x is a LazyTensor, max(x, index) will :

  • if index = "i", return the max reduction of x over the i indexes.

  • if index = "j", return the max reduction of x over the j indexes.

  • if index = NA (default), return a new LazyTensor object representing the symbolic max of the values along the inner dimension of x.

Notes: If index = NA, x input argument should be a LazyTensor encoding a parameter vector.

Note: Run browseVignettes("rkeops") to access the vignettes and find details about this function in the "RKeOps LazyTensor" vignette, at section "Reductions".

Note: index input argument cannot be NA for the max_reduction() function.

See also

max_reduction()

Author

Chloe Serre-Combe, Amelie Vernay

Examples

if (FALSE) {
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i')   # creating LazyTensor from matrix x, 
                                    # indexed by 'i'

max_x <- max(x_i)                   # LazyTensor object
max_red_x <- max(x_i, "i")          # max reduction indexed by 'i'
}
if (FALSE) {
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i')   # creating LazyTensor from matrix x, 
                                    # indexed by 'i'

max_reduction(x_i, "i")
}