gather

function gather<Value>(a:Integer[_], x:Value[_]) -> Value[_]

Gather.

  • a: Indices.
  • x: Source vector.

Returns: a vector y where y[n] == x[a[n]].