return out;
}
public static void setfancy(ArrayBoolean1d from, ArrayBoolean1d to, ArrayBoolean1d selection) throws IllegalArgumentException {
if (to.len() != selection.len()) {
throw new IllegalArgumentException();
}
int count = 0;
for (int i = 0; i < selection.len(); i++) {
if (selection.get(i)) { count += 1; }
}
if (from.len() != count) {
throw new IllegalArgumentException();
}
int j = 0;
for (int i = 0; i < selection.len(); i++) {
if (selection.get(i)) {