static Matrix listToMatrix(int _w, int _h, L data) {
class ListToMatrix extends AbstractMatrix {
*() { super(_w, _h); }
int xyToIndex(int x, int y) {
ret y*w+x;
}
public A get(int x, int y) { ret data.get(xyToIndex(x, y)); }
public void set(int x, int y, A a) { data.set(xyToIndex(x, y), a); }
};
ret new ListToMatrix;
}