Matrix m = new Matrix(prim.body);
LUDecomposition decomp = new LUDecomposition(m);
Matrix solution = new Matrix(prim.solution);
try {
return decomp.solve(solution);
} catch (RuntimeException e) {
if (e.getMessage().equals("Matrix is singular.")) {
throw new AmbiguousLayoutException();
} else {
throw e;