Learn R Programming

cayleyR (version 0.2.1)

reverse_prefix: Reverse First k Elements (with Coordinates)

Description

Reverses the first k elements of the state vector (turnstile operation). Tracks celestial coordinates (LRX momentum).

Value

List with components:

state

Integer vector with first k elements reversed

coords

List of updated celestial coordinates (nL, nR, nX, theta, phi, omega_conformal)

Arguments

state

Integer vector representing the current permutation state

k

Integer, number of elements to reverse from the beginning

coords

Optional list of current celestial coordinates. If NULL, starts from zero coordinates.

Examples

Run this code
result <- reverse_prefix(1:10, k = 4)
result$state

Run the code above in your browser using DataLab