public static boolean matrixCompare(double[][] A, double[][] B) {
		if (A.length != B.length)
			return false;
		for (int i = 0; i < A.length; i++) {
			if (A[i].length != B[i].length)
				return false;
			for (int j = 0; j < A[i].length; j++)
				if (Math.abs(A[i][j] - B[i][j]) > eps)
					return false;
		}

		return true;
	}