Is it possible to implement an efficient reverse on a rrb-vector resulting in an rrb-vector? This would be pretty useful in scenarios like the 2-opt neighborhood for local search for the Traveling Salesman Problem. The complete operation is as follows.
Given: a = (link: a_0, a1, ..., a{n-1}, a{n}, a{n+1}, ..., a{n+k-2}, a{n+k-1}, a{n+k}, ..., a{n+k+m-1})
Goal: (link: a_0, a1, ..., a{n-1}, a{n+k-1}, a{n+k-2}, ..., a{n+1}, a{n}, a{n+k}, ..., a{n+k+m-1})
Possible Clojure implementation of the described operation:
(let [x (subvec a 0 n), y (subvec a n (+ n k)), z (subvec a (+ n k))]
(catvec x, (reverse-vec y), z))