sbool eqMatrices(Matrix a, Matrix b) { if (a == null || b == null) ret a == b; int w = a.getWidth(), h = a.getHeight(); if (b.getWidth() != w || b.getHeight() != h) false; for y to h: for x to w: if (!eq(a.get(x, y), b.get(x, y))) false; true; }