Applies a sequence of shift and reverse operations to a permutation state.
Operations can be specified as "1"/"L" (shift left), "2"/"R" (shift right),
or "3"/"X" (reverse prefix). Tracks celestial coordinates.
Value
List with components:
state
Integer vector after all operations applied
coords
List of final celestial coordinates (nL, nR, nX, theta, phi, omega_conformal)
Arguments
state
Integer vector representing the current permutation state
operations
Character vector of operations ("1"/"L", "2"/"R", "3"/"X")
k
Integer, parameter for reverse operations
coords
Optional list of current celestial coordinates. If NULL,
starts from zero coordinates.
result <- apply_operations(1:10, c("1", "3", "2"), k = 4)
result$state
# Using letter codesresult <- apply_operations(1:20, c("L", "X", "R"), k = 4)
result$state