Learn R Programming

cayleyR (version 0.2.1)

apply_operations_batch_gpu: Apply operations to batch of states on GPU

Description

Applies a sequence of permutation operations to multiple states simultaneously using matrix multiplication on the Vulkan backend.

Usage

apply_operations_batch_gpu(states_matrix, operations, k)

Value

Numeric matrix (nrow x n) with transformed states

Arguments

states_matrix

Numeric matrix (nrow x n), each row is a state

operations

Character vector of operation codes (e.g., c("L", "R", "X"))

k

Integer, parameter for reverse operations

Examples

Run this code
# \donttest{
if (cayley_gpu_available()) {
  mat <- matrix(c(1,2,3,4,5, 5,4,3,2,1), nrow = 2, byrow = TRUE)
  result <- apply_operations_batch_gpu(mat, c("1", "3"), k = 4)
}
# }

Run the code above in your browser using DataLab