private boolean isPrimalFeasible(){
  double[] x=row();
  double sum=0.0;
  for (int j=0; j < n; j++) {
    if (x[j] < 0) {
      StdOut.println("row vector not a probability distribution");
      StdOut.printf("    x[%d] = %f\n",j,x[j]);
      return false;
    }
    sum+=x[j];
  }
  if (Math.abs(sum - 1.0) > EPSILON) {
    StdOut.println("row vector x[] is not a probability distribution");
    StdOut.println("    sum = " + sum);
    return false;
  }
  return true;
}

private boolean isPrimalFeasible ( ) { double [ ] x = row ( ) ; double sum = 0.0 ; for ( int j = 0 ; j < n ; j ++ ) { if ( x [ j ] < 0 ) { StdOut . println ( "row vector not a probability distribution" ) ; StdOut . printf ( "    x[%d] = %f\n" , j , x [ j ] ) ; return false ; } sum += x [ j ] ; } if ( Math . abs ( sum - 1.0 ) > EPSILON ) { StdOut . println ( "row vector x[] is not a probability distribution" ) ; StdOut . println ( "    sum = " + sum ) ; return false ; } return true ; }
the code below is solely for testing correctness of the data type .
