private boolean check(double[][] A, double[] b) {

        if (isFeasible()) {
            double[] x = primal();
            for (int i = 0; i < N; i++) {
                double sum = 0.0;
                for (int j = 0; j < N; j++) {
                     sum += A[i][j] * x[j];
                }
                if (Math.abs(sum - b[i]) > EPSILON) {
                    result.append(String.format("Not Feasible\n"));
                    result.append(String.format("b[%d] = %8.3f, sum = %8.3f\n\n", i, b[i], sum));
                    return false;
                }
            }
            return true;
        }
        else {
            double[] y = dual();
            for (int j = 0; j < N; j++) {
                double sum = 0.0;
                for (int i = 0; i < N; i++) {
                     sum += A[i][j] * y[i];
                }
                if (Math.abs(sum) > EPSILON) {
                    result.append(String.format("Invalid Certificate of Infeasibility\n\n"));
                    result.append(String.format("sum = %8.3f\n", sum));
                    return false;
                }
            }
            double sum = 0.0;
            for (int i = 0; i < N; i++) {
                sum += y[i] * b[i];
            }
            if (Math.abs(sum) < EPSILON) {
                result.append(String.format("Invalid Certificate of Infeasibility\n\n"));
                result.append(String.format("yb  = %8.3f\n", sum));
                return false;
            }
            return true;
        }
    }