}
return out;
}
public static ArrayInteger1d getfancy(ArrayInteger1d array, ArrayInteger1d selection) {
ArrayInteger1d out = new ArrayInteger1d(selection.len());
for (int i = 0; i < selection.len(); i++) {
int index = selection.get(i);
if (index < 0) {
index = array.len() + index;
}
out.set(i, array.get(index));
}
return out;
}