Program: 57432
Project: 57432
Buggy source:
/** 
 * Create the tableau by itself.
 * @param maximize if true, goal is to maximize the objective function
 * @return created tableau
 */
protected double[][] createTableau(final boolean maximize){
  List<LinearConstraint> constraints=getNormalizedConstraints();
  int width=numDecisionVariables + numSlackVariables + numArtificialVariables+ getNumObjectiveFunctions()+ 1;
  int height=constraints.size() + getNumObjectiveFunctions();
  double[][] matrix=new double[height][width];
  if (getNumObjectiveFunctions() == 2) {
    matrix[0][0]=-1;
  }
  int zIndex=(getNumObjectiveFunctions() == 1) ? 0 : 1;
  matrix[zIndex][zIndex]=maximize ? 1 : -1;
  RealVector objectiveCoefficients=maximize ? f.getCoefficients().mapMultiply(-1) : f.getCoefficients();
  copyArray(objectiveCoefficients.getData(),matrix[zIndex],getNumObjectiveFunctions());
  matrix[zIndex][width - 1]=maximize ? f.getConstantTerm() : -1 * f.getConstantTerm();
  if (!restrictToNonNegative) {
    matrix[zIndex][getSlackVariableOffset() - 1]=getInvertedCoeffiecientSum(objectiveCoefficients);
  }
  int slackVar=0;
  int artificialVar=0;
  for (int i=0; i < constraints.size(); i++) {
    LinearConstraint constraint=constraints.get(i);
    int row=getNumObjectiveFunctions() + i;
    copyArray(constraint.getCoefficients().getData(),matrix[row],1);
    if (!restrictToNonNegative) {
      matrix[row][getSlackVariableOffset() - 1]=getInvertedCoeffiecientSum(constraint.getCoefficients());
    }
    matrix[row][width - 1]=constraint.getValue();
    if (constraint.getRelationship() == Relationship.LEQ) {
      matrix[row][getSlackVariableOffset() + slackVar++]=1;
    }
 else     if (constraint.getRelationship() == Relationship.GEQ) {
      matrix[row][getSlackVariableOffset() + slackVar++]=-1;
    }
    if ((constraint.getRelationship() == Relationship.EQ) || (constraint.getRelationship() == Relationship.GEQ)) {
      matrix[0][getArtificialVariableOffset() + artificialVar]=1;
      matrix[row][getArtificialVariableOffset() + artificialVar++]=1;
    }
  }
  return matrix;
}

Fixed version (ground truth):
/** 
 * Create the tableau by itself.
 * @param maximize if true, goal is to maximize the objective function
 * @return created tableau
 */
protected double[][] createTableau(final boolean maximize){
  int width=numDecisionVariables + numSlackVariables + numArtificialVariables+ getNumObjectiveFunctions()+ 1;
  int height=constraints.size() + getNumObjectiveFunctions();
  double[][] matrix=new double[height][width];
  if (getNumObjectiveFunctions() == 2) {
    matrix[0][0]=-1;
  }
  int zIndex=(getNumObjectiveFunctions() == 1) ? 0 : 1;
  matrix[zIndex][zIndex]=maximize ? 1 : -1;
  RealVector objectiveCoefficients=maximize ? f.getCoefficients().mapMultiply(-1) : f.getCoefficients();
  copyArray(objectiveCoefficients.getData(),matrix[zIndex],getNumObjectiveFunctions());
  matrix[zIndex][width - 1]=maximize ? f.getConstantTerm() : -1 * f.getConstantTerm();
  if (!restrictToNonNegative) {
    matrix[zIndex][getSlackVariableOffset() - 1]=getInvertedCoeffiecientSum(objectiveCoefficients);
  }
  int slackVar=0;
  int artificialVar=0;
  for (int i=0; i < constraints.size(); i++) {
    LinearConstraint constraint=constraints.get(i);
    int row=getNumObjectiveFunctions() + i;
    copyArray(constraint.getCoefficients().getData(),matrix[row],1);
    if (!restrictToNonNegative) {
      matrix[row][getSlackVariableOffset() - 1]=getInvertedCoeffiecientSum(constraint.getCoefficients());
    }
    matrix[row][width - 1]=constraint.getValue();
    if (constraint.getRelationship() == Relationship.LEQ) {
      matrix[row][getSlackVariableOffset() + slackVar++]=1;
    }
 else     if (constraint.getRelationship() == Relationship.GEQ) {
      matrix[row][getSlackVariableOffset() + slackVar++]=-1;
    }
    if ((constraint.getRelationship() == Relationship.EQ) || (constraint.getRelationship() == Relationship.GEQ)) {
      matrix[0][getArtificialVariableOffset() + artificialVar]=1;
      matrix[row][getArtificialVariableOffset() + artificialVar++]=1;
    }
  }
  return matrix;
}