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

		// check that Ax = 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 ) {
					System.out.println( "not feasible" );
					System.out.printf( "b[%d] = %8.3f, sum = %8.3f\n", i, b[i], sum );
					return false;
				}
			}
			return true;
		}

		// or that yA = 0, yb != 0
		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 ) {
					System.out.println( "invalid certificate of infeasibility" );
					System.out.printf( "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 ) {
				System.out.println( "invalid certificate of infeasibility" );
				System.out.printf( "yb  = %8.3f\n", sum );
				return false;
			}
			return true;
		}
	}